NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
Subsystems (2)
Dai Ngo
reviewerPATCH v2 1/1 NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
The NFS server should ask clients to voluntarily return unused delegations when the number of granted delegations reaches the max_delegations. This is so that the server can continue to grant delegations for new requests.
--- fs/nfsd/nfs4state.c | 3 +++ 1 file changed, 3 insertions(+)
v2: move declaration of deleg_reaper() up to other forward
declarations in the file.
fs/nfsd/nfs4state.c +3 -0
@@ -87,6 +87,7 @@ static void nfs4_free_ol_stateid(struct nfs4_stid *stid);void nfsd4_end_grace (struct nfsd_net *nn);static void _free_cpntf_state_locked (struct nfsd_net *nn,struct nfs4_cpntf_state *cps);static void nfsd4_file_hash_remove (struct nfs4_file *fi); +static void deleg_reaper (struct nfsd_net *nn);/* Locking: */
@@ -6550,6 +6551,8 @@ nfs4_laundromat(struct nfsd_net *nn)/* service the server-to-server copy delayed unmount list */ nfsd4_ssc_expire_umount (nn);#endif +if (atomic_long_read (&num_delegations) >= max_delegations) +deleg_reaper (nn); out:return max_t (time64_t, lt.new_timeo,NFSD_LAUNDROMAT_MINTIMEOUT ); }
Signature · 1 line
2.39.3
Quoted 10 lines
-----邮件原件-----
发件人: Dai Ngo <[email protected]>
发送时间: 2024年3月4日 6:23
收件人: [email protected]; [email protected]
抄送: [email protected]
主题: [PATCH v2 1/1] NFSD: sendOP_CB_RECALL_ANYto clients when number of delegations reaches its limit
Quoted 8 lines
The NFS server should ask clients to voluntarily return unused delegations when the number of granted delegations reaches the
max_delegations. This is so that the server can continue to grant delegations for new requests.Signed-off-by Dai Ngo <[email protected]>---
Regards,
- Chen
Quoted 26 lines · Dai Ngo
The NFS server should ask clients to voluntarily return unused delegations when the number of granted delegations reaches the
max_delegations. This is so that the server can continue to grant delegations for new requests.Signed-off-by Dai Ngo <[email protected]>--- fs/nfsd/nfs4state.c | 3 +++ 1 file changed, 3 insertions(+)v2: move declaration of
deleg_reaper()up to other forward
declarations in the file.fs/nfsd/nfs4state.c +1
-0@@ -87,6 +87,7 @@ static void nfs4_free_ol_stateid(struct nfs4_stid *stid);void nfsd4_end_grace (struct nfsd_net *nn);static void _free_cpntf_state_locked (struct nfsd_net *nn,struct nfs4_cpntf_state *cps);static void nfsd4_file_hash_remove (struct nfs4_file *fi); +static void deleg_reaper (struct nfsd_net *nn);/* Locking: */
fs/nfsd/nfs4state.c nfs4_laundromat(struct nfsd_net *nn) · line 6558
Quoted 8 lines
fs/nfsd/nfs4state.c +2
-0@@ -6550,6 +6551,8 @@ nfs4_laundromat(struct nfsd_net *nn)/* service the server-to-server copy delayed unmount list */ nfsd4_ssc_expire_umount (nn);#endif +if (atomic_long_read (&num_delegations) >= max_delegations) +deleg_reaper (nn); out:return max_t (time64_t, lt.new_timeo,NFSD_LAUNDROMAT_MINTIMEOUT ); }
Seems like a reasonable thing to do:
Chuck Lever
AppliedQuoted 37 lines · Dai Ngo
The NFS server should ask clients to voluntarily return unused delegations when the number of granted delegations reaches the
max_delegations. This is so that the server can continue to grant delegations for new requests.Signed-off-by Dai Ngo <[email protected]>--- fs/nfsd/nfs4state.c | 3 +++ 1 file changed, 3 insertions(+)v2: move declaration of
deleg_reaper()up to other forward
declarations in the file.fs/nfsd/nfs4state.c +3
-0@@ -87,6 +87,7 @@ static void nfs4_free_ol_stateid(struct nfs4_stid *stid);void nfsd4_end_grace (struct nfsd_net *nn);static void _free_cpntf_state_locked (struct nfsd_net *nn,struct nfs4_cpntf_state *cps);static void nfsd4_file_hash_remove (struct nfs4_file *fi); +static void deleg_reaper (struct nfsd_net *nn);/* Locking: */ @@ -6550,6 +6551,8 @@ nfs4_laundromat(struct nfsd_net *nn)/* service the server-to-server copy delayed unmount list */ nfsd4_ssc_expire_umount (nn);#endif +if (atomic_long_read (&num_delegations) >= max_delegations) +deleg_reaper (nn); out:return max_t (time64_t, lt.new_timeo,NFSD_LAUNDROMAT_MINTIMEOUT ); }Signature · 1 line
2.39.3
Applied to nfsd-next. Thanks, Dai!
Signature · 1 line
Chuck Lever
Quoted 5 lines · Dai Ngo
The NFS server should ask clients to voluntarily return unused delegations when the number of granted delegations reaches the
max_delegations. This is so that the server can continue to grant delegations for new requests.
What is this limit max_delegations? Where is it set, and where can an admin alter it at runtime?
Are you aware that for example the msnfs41client Windows NFSv4.1 driver easily uses a few hundred delegations, as required by the highly multithreaded nature (i.e. every Win32 syscall is async) of the Windows kernel?
Ced
Signature · 3 lines
Cedric Blancher <[email protected]> [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur
Dai Ngo
reviewerQuoted 6 lines · Cedric Blancher
Quoted 4 lines · Dai Ngo
The NFS server should ask clients to voluntarily return unused delegations when the number of granted delegations reaches the
max_delegations. This is so that the server can continue to grant delegations for new requests.What is this limit
max_delegations?
4 delegations per megabyte of available RAM.
Quoted 1 line
Where is it set,
when nfsd starts up.
Quoted 2 lines
and where can an
admin alter it at runtime?
There is no admin tool to change this setting. But if you want to play with it then you can poke the memory and change its value, The code uses max_delegations dynamically.
-Dai
Quoted 7 lines
Are you aware that for example the msnfs41client Windows NFSv4.1 driver easily uses a few hundred delegations, as required by the highly multithreaded nature (i.e. every Win32 syscall is async) of the Windows kernel?
Ced