linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
@ 2024-02-20 23:58 Dai Ngo
  2024-02-21 22:55 ` Calum Mackay
  0 siblings, 1 reply; 3+ messages in thread
From: Dai Ngo @ 2024-02-20 23:58 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
hand out delegations for new requests.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
 fs/nfsd/nfs4state.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index fdc95bfbfbb6..a0bd6f6b994d 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -130,6 +130,7 @@ static const struct nfsd4_callback_ops nfsd4_cb_notify_lock_ops;
 static const struct nfsd4_callback_ops nfsd4_cb_getattr_ops;
 
 static struct workqueue_struct *laundry_wq;
+static void deleg_reaper(struct nfsd_net *nn);
 
 int nfsd4_create_laundry_wq(void)
 {
@@ -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] 3+ messages in thread

* Re: [PATCH 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
  2024-02-20 23:58 [PATCH 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit Dai Ngo
@ 2024-02-21 22:55 ` Calum Mackay
  2024-02-21 23:52   ` dai.ngo
  0 siblings, 1 reply; 3+ messages in thread
From: Calum Mackay @ 2024-02-21 22:55 UTC (permalink / raw)
  To: Dai Ngo, chuck.lever, jlayton; +Cc: Calum Mackay, linux-nfs


[-- Attachment #1.1: Type: text/plain, Size: 1424 bytes --]

hi Dai,

On 20/02/2024 11:58 pm, 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
> hand out delegations for new requests.
> 
> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
> ---
>   fs/nfsd/nfs4state.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index fdc95bfbfbb6..a0bd6f6b994d 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -130,6 +130,7 @@ static const struct nfsd4_callback_ops nfsd4_cb_notify_lock_ops;
>   static const struct nfsd4_callback_ops nfsd4_cb_getattr_ops;
>   
>   static struct workqueue_struct *laundry_wq;
> +static void deleg_reaper(struct nfsd_net *nn);

Nits: If this is actually needed (you seem to be calling it after it is 
defined?), shouldn't it be with the other forward decls around lines 84–89?

cheers,
calum.

>   
>   int nfsd4_create_laundry_wq(void)
>   {
> @@ -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);
>   }



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
  2024-02-21 22:55 ` Calum Mackay
@ 2024-02-21 23:52   ` dai.ngo
  0 siblings, 0 replies; 3+ messages in thread
From: dai.ngo @ 2024-02-21 23:52 UTC (permalink / raw)
  To: Calum Mackay, chuck.lever, jlayton; +Cc: linux-nfs


On 2/21/24 2:55 PM, Calum Mackay wrote:
> hi Dai,
>
> On 20/02/2024 11:58 pm, 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
>> hand out delegations for new requests.
>>
>> Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
>> ---
>>   fs/nfsd/nfs4state.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
>> index fdc95bfbfbb6..a0bd6f6b994d 100644
>> --- a/fs/nfsd/nfs4state.c
>> +++ b/fs/nfsd/nfs4state.c
>> @@ -130,6 +130,7 @@ static const struct nfsd4_callback_ops 
>> nfsd4_cb_notify_lock_ops;
>>   static const struct nfsd4_callback_ops nfsd4_cb_getattr_ops;
>>     static struct workqueue_struct *laundry_wq;
>> +static void deleg_reaper(struct nfsd_net *nn);
>
> Nits: If this is actually needed (you seem to be calling it after it 
> is defined?), 

Yes, it's needed for a clean build:

fs/nfsd/nfs4state.c:6554:17: error: implicit declaration of function ‘deleg_reaper’ [-Werror=implicit-function-declaration]

> shouldn't it be with the other forward decls around lines 84–89?

I'll move it up in v2.

Thanks,
-Dai

>
> cheers,
> calum.
>
>>     int nfsd4_create_laundry_wq(void)
>>   {
>> @@ -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);
>>   }
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-21 23:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-20 23:58 [PATCH 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit Dai Ngo
2024-02-21 22:55 ` Calum Mackay
2024-02-21 23:52   ` dai.ngo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).