public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Dai Ngo <dai.ngo@oracle.com>, chuck.lever@oracle.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 1/1] NFSD: send OP_CB_RECALL_ANY to clients when number of delegations reaches its limit
Date: Mon, 04 Mar 2024 07:57:34 -0500	[thread overview]
Message-ID: <dc8ab748ac7fff7969a27bbcf6971b018d51373f.camel@kernel.org> (raw)
In-Reply-To: <1709504582-8311-1-git-send-email-dai.ngo@oracle.com>

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>

  parent reply	other threads:[~2024-03-04 12:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-03-04 14:11 ` Chuck Lever
2024-03-05  8:49 ` Cedric Blancher
2024-03-07 18:14   ` Dai Ngo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc8ab748ac7fff7969a27bbcf6971b018d51373f.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox