* [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
@ 2024-03-03 22:23 Dai Ngo
2024-03-04 6:20 ` 回复: " Hanxiao Chen (Fujitsu)
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Dai Ngo @ 2024-03-03 22:23 UTC (permalink / raw)
To: chuck.lever, jlayton; +Cc: linux-nfs
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 <dai.ngo@oracle.com>
---
fs/nfsd/nfs4state.c | 3 +++
1 file changed, 3 insertions(+)
v2: move declaration of deleg_reaper() up to other forward
declarations in the file.
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index fdc95bfbfbb6..961000261b3e 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -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);
}
--
2.39.3
^ permalink raw reply related [flat|nested] 6+ messages in thread* 回复: [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
2024-03-03 22:23 [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit Dai Ngo
@ 2024-03-04 6:20 ` Hanxiao Chen (Fujitsu)
2024-03-04 12:57 ` Jeff Layton
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Hanxiao Chen (Fujitsu) @ 2024-03-04 6:20 UTC (permalink / raw)
To: Dai Ngo, chuck.lever@oracle.com, jlayton@kernel.org
Cc: linux-nfs@vger.kernel.org
> -----邮件原件-----
> 发件人: Dai Ngo <dai.ngo@oracle.com>
> 发送时间: 2024年3月4日 6:23
> 收件人: chuck.lever@oracle.com; jlayton@kernel.org
> 抄送: linux-nfs@vger.kernel.org
> 主题: [PATCH 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.
>
> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> ---
>
Tested-by: Chen Hanxiao <chenhx.fnst@fujitsu.com>
Regards,
- Chen
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
2024-03-03 22:23 [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit Dai Ngo
2024-03-04 6:20 ` 回复: " Hanxiao Chen (Fujitsu)
@ 2024-03-04 12:57 ` Jeff Layton
2024-03-04 14:11 ` Chuck Lever
2024-03-05 8:49 ` Cedric Blancher
3 siblings, 0 replies; 6+ messages in thread
From: Jeff Layton @ 2024-03-04 12:57 UTC (permalink / raw)
To: Dai Ngo, chuck.lever; +Cc: linux-nfs
On Sun, 2024-03-03 at 14:23 -0800, Dai Ngo wrote:
> 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 <dai.ngo@oracle.com>
> ---
> fs/nfsd/nfs4state.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> v2: move declaration of deleg_reaper() up to other forward
> declarations in the file.
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index fdc95bfbfbb6..961000261b3e 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -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);
> }
Seems like a reasonable thing to do:
Reviewed-by: Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
2024-03-03 22:23 [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit Dai Ngo
2024-03-04 6:20 ` 回复: " Hanxiao Chen (Fujitsu)
2024-03-04 12:57 ` Jeff Layton
@ 2024-03-04 14:11 ` Chuck Lever
2024-03-05 8:49 ` Cedric Blancher
3 siblings, 0 replies; 6+ messages in thread
From: Chuck Lever @ 2024-03-04 14:11 UTC (permalink / raw)
To: Dai Ngo; +Cc: jlayton@kernel.org, linux-nfs@vger.kernel.org
On Sun, Mar 03, 2024 at 05:23:02PM -0500, Dai Ngo wrote:
> 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 <dai.ngo@oracle.com>
> ---
> fs/nfsd/nfs4state.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> v2: move declaration of deleg_reaper() up to other forward
> declarations in the file.
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index fdc95bfbfbb6..961000261b3e 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -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);
> }
> --
> 2.39.3
>
Applied to nfsd-next. Thanks, Dai!
--
Chuck Lever
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
2024-03-03 22:23 [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit Dai Ngo
` (2 preceding siblings ...)
2024-03-04 14:11 ` Chuck Lever
@ 2024-03-05 8:49 ` Cedric Blancher
2024-03-07 18:14 ` Dai Ngo
3 siblings, 1 reply; 6+ messages in thread
From: Cedric Blancher @ 2024-03-05 8:49 UTC (permalink / raw)
To: linux-nfs
On Sun, 3 Mar 2024 at 23:23, Dai Ngo <dai.ngo@oracle.com> wrote:
>
> 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
--
Cedric Blancher <cedric.blancher@gmail.com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
2024-03-05 8:49 ` Cedric Blancher
@ 2024-03-07 18:14 ` Dai Ngo
0 siblings, 0 replies; 6+ messages in thread
From: Dai Ngo @ 2024-03-07 18:14 UTC (permalink / raw)
To: Cedric Blancher, linux-nfs
On 3/5/24 12:49 AM, Cedric Blancher wrote:
> On Sun, 3 Mar 2024 at 23:23, Dai Ngo <dai.ngo@oracle.com> wrote:
>> 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.
> Where is it set,
when nfsd starts up.
> 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
>
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-07 18:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-03 22:23 [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit Dai Ngo
2024-03-04 6:20 ` 回复: " Hanxiao Chen (Fujitsu)
2024-03-04 12:57 ` Jeff Layton
2024-03-04 14:11 ` Chuck Lever
2024-03-05 8:49 ` Cedric Blancher
2024-03-07 18:14 ` Dai Ngo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox