linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Dai Ngo <dai.ngo@oracle.com>
Cc: Bruce Fields <bfields@fieldses.org>,
	Jeff Layton <jlayton@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH RFC v9 2/2] nfsd: Initial implementation of NFSv4 Courteous Server
Date: Tue, 11 Jan 2022 15:49:19 +0000	[thread overview]
Message-ID: <D2CF771C-FF71-4356-8567-33427EAC0DA9@oracle.com> (raw)
In-Reply-To: <f5ba01ea-33e8-03e9-2cee-8ff7814abceb@oracle.com>



> On Jan 10, 2022, at 8:03 PM, Dai Ngo <dai.ngo@oracle.com> wrote:
> 
> Thank you Chuck for your review, please see reply below:
> 
> On 1/10/22 3:17 PM, Chuck Lever III wrote:
>> Hi Dai-
>> 
>> Still getting the feel of the new approach, but I have
>> made some comments inline...
>> 
>> 
>>> On Jan 10, 2022, at 1:50 PM, Dai Ngo <dai.ngo@oracle.com> wrote:
>>> 
>>> 	seq_printf(m, "\nminor version: %d\n", clp->cl_minorversion);
>>> @@ -2809,8 +2835,17 @@ find_clp_in_name_tree(struct xdr_netobj *name, struct rb_root *root)
>>> 			node = node->rb_left;
>>> 		else if (cmp < 0)
>>> 			node = node->rb_right;
>>> -		else
>>> -			return clp;
>>> +		else {
>>> +			spin_lock(&clp->cl_cs_lock);
>>> +			if (!test_bit(NFSD4_DESTROY_COURTESY_CLIENT,
>>> +					&clp->cl_flags)) {
>>> +				clear_bit(NFSD4_COURTESY_CLIENT, &clp->cl_flags);
>>> +				spin_unlock(&clp->cl_cs_lock);
>>> +				return clp;
>>> +			}
>>> +			spin_unlock(&clp->cl_cs_lock);
>>> +			return NULL;
>>> +		}
>>> 	}
>>> 	return NULL;
>>> }
>>> @@ -2856,6 +2891,14 @@ find_client_in_id_table(struct list_head *tbl, clientid_t *clid, bool sessions)
>>> 		if (same_clid(&clp->cl_clientid, clid)) {
>>> 			if ((bool)clp->cl_minorversion != sessions)
>>> 				return NULL;
>>> +			spin_lock(&clp->cl_cs_lock);
>>> +			if (test_bit(NFSD4_DESTROY_COURTESY_CLIENT,
>>> +					&clp->cl_flags)) {
>>> +				spin_unlock(&clp->cl_cs_lock);
>>> +				continue;
>>> +			}
>>> +			clear_bit(NFSD4_COURTESY_CLIENT, &clp->cl_flags);
>>> +			spin_unlock(&clp->cl_cs_lock);
>> I'm wondering about the transition from COURTESY to active.
>> Does that need to be synchronous with the client tracking
>> database?
> 
> Currently when the client transits from active to COURTESY,
> we do not remove the client record from the tracking database
> so on the reverse we do not need to add it back.
> 
> I think this is something you and Bruce have been discussing
> on whether when we should remove and add the client record from
> the database when the client transits from active to COURTESY
> and vice versa. With this patch we now expire the courtesy clients
> asynchronously in the background so the overhead/delay from
> removing the record from the database does not have any impact
> on resolving conflicts.

As I recall, our idea was to record the client as expired when
it transitions from active to COURTEOUS so that if the server
happens to reboot, it doesn't allow a courteous client to
reclaim locks the server may have already given to another
active client.

So I think the server needs to do an nfsdtrack upcall when
transitioning from active -> COURTEOUS to prevent that edge
case. That would happen only in the laundromat, right?

So when a COURTEOUS client comes back to the server, the server
will need to persistently record the transition from COURTEOUS
to active.

--
Chuck Lever




  reply	other threads:[~2022-01-11 15:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 18:50 [PATCH RFC v9 0/2] nfsd: Initial implementation of NFSv4 Courteous Server Dai Ngo
2022-01-10 18:50 ` [PATCH RFC v9 1/2] fs/lock: add new callback, lm_expire_lock, to lock_manager_operations Dai Ngo
2022-01-10 18:50 ` [PATCH RFC v9 2/2] nfsd: Initial implementation of NFSv4 Courteous Server Dai Ngo
2022-01-10 23:17   ` Chuck Lever III
2022-01-11  1:03     ` dai.ngo
2022-01-11 15:49       ` Chuck Lever III [this message]
2022-01-12 18:53         ` Bruce Fields
2022-01-12 18:56           ` dai.ngo
2022-01-12 19:40   ` J. Bruce Fields
2022-01-13  8:51     ` dai.ngo
2022-01-13 15:42       ` J. Bruce Fields
2022-01-13 19:51         ` dai.ngo
2022-01-12 19:52   ` J. Bruce Fields
2022-01-10 19:03 ` [PATCH RFC v9 0/2] " Chuck Lever III
2022-01-12 18:59 ` J. Bruce Fields
2022-01-12 19:05   ` dai.ngo
2022-01-12 19:21     ` J. Bruce Fields
2022-01-12 19:31       ` dai.ngo
2022-01-12 19:42         ` J. Bruce Fields
2022-01-12 20:34           ` dai.ngo
2022-01-12 20:39             ` J. Bruce Fields
  -- strict thread matches above, loose matches on Subject: below --
2022-01-10 18:40 Dai Ngo
2022-01-10 18:40 ` [PATCH RFC v9 2/2] " 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=D2CF771C-FF71-4356-8567-33427EAC0DA9@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=bfields@fieldses.org \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).