All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: dai.ngo@oracle.com
Cc: chuck.lever@oracle.com, jlayton@redhat.com,
	viro@zeniv.linux.org.uk, linux-nfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH RFC v25 0/7] NFSD: Initial implementation of NFSv4 Courteous Server
Date: Mon, 23 May 2022 11:40:26 -0400	[thread overview]
Message-ID: <20220523154026.GD24163@fieldses.org> (raw)
In-Reply-To: <9b394762-660b-4742-b54a-2b385485b412@oracle.com>

On Mon, May 02, 2022 at 06:38:03PM -0700, dai.ngo@oracle.com wrote:
> 
> On 5/2/22 6:21 PM, J. Bruce Fields wrote:
> >On Mon, May 02, 2022 at 09:12:52PM -0400, J. Bruce Fields wrote:
> >>Looks good to me.
> >And the only new test failures are due to the new DELAYs on OPEN.
> >Somebody'll need to fix up pynfs.  (I'm not volunteering for now.)
> 
> I will fix it, since I broke it :-)

By the way, I have three more notes on courtesy server stuff that I
wanted to dump into email before I forget them:

1. I do still recommend fixing up those pynfs failures.  The ones I see
   are in RENEW3, LKU10, CLOSE9, CLOSE8, but there may be others.

2. In the lock case, nfsd4_lock() holds an st_mutex while calling
   vfs_lock_file(), which may end up needing to wait for the laundromat.
   As I said in review, I don't see a potential deadlock there, so I'm
   fine with the code going in as is.

   But, as a note for possible cleanup, or if this does turn into a
   problem later: vfs_lock_file could return to nfsd4_lock(), and
   nfsd4_lock() could easily drop the st_mutex, wait, and retry.

   I think the only trick part would be deciding on conventions for the
   caller to tell vfs_lock_file() that it shouldn't wait in this case
   (non-nfsd callers will still want to wait), and for vfs_lock_file()
   to indicate the caller needs to retry.  Probably something in
   fl_flags for the former, and an agreed-on error return for the
   latter?

3. One other piece of future work would be optimizing the conflicting
   lock case.  A very premature optimization at this point, but I'm just
   leaving my notes here in case someone's interested:

   The loop in posix_lock_inode() is currently O(N^2) in the number of
   expirable clients holding conflicting locks, because each time we
   encounter one, we wait and then restart.  In practice I doubt that
   matters--if you have a lot of clients to expire, the time rescanning
   the list will likely be trivial compared to the time spent waiting
   for nfsdcld to commit the expiry of each client to stable storage.

   *However*, it might be a more significant optimization if we first
   allowed more parallelism in nfsdcld.  And that might also benefit
   some other cases (e.g., lots of clients reconnecting after a crash).
   We'd need paralle nfsdcld--no idea what that would involve--and I
   think it'd also help to update the kernel<->nfsdcld protocol with a
   separate commit operation, so that nfsd could issue a bunch of client
   changes and then a single commit to wait for them all.

   That done, we could modify the loop in vfs_lock_file() so that, in
   the case where multiple clients hold conflicting locks, the loop
   marks them all for expiry in one pass, then waits just once at the
   end.

--b.

  reply	other threads:[~2022-05-23 15:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-02 21:19 [PATCH RFC v25 0/7] NFSD: Initial implementation of NFSv4 Courteous Server Dai Ngo
2022-05-02 21:19 ` [PATCH RFC v25 1/7] NFSD: add courteous server support for thread with only delegation Dai Ngo
2022-05-02 21:19 ` [PATCH RFC v25 2/7] NFSD: add support for share reservation conflict to courteous server Dai Ngo
2022-05-02 21:19 ` [PATCH RFC v25 3/7] NFSD: move create/destroy of laundry_wq to init_nfsd and exit_nfsd Dai Ngo
2022-05-02 21:19 ` [PATCH RFC v25 4/7] fs/lock: add helper locks_owner_has_blockers to check for blockers Dai Ngo
2022-05-09 17:05   ` Jeff Layton
2022-05-02 21:19 ` [PATCH RFC v25 5/7] fs/lock: add 2 callbacks to lock_manager_operations to resolve conflict Dai Ngo
2022-05-09 15:41   ` Chuck Lever III
2022-05-09 17:03   ` Jeff Layton
2022-05-02 21:19 ` [PATCH RFC v25 6/7] NFSD: add support for lock conflict to courteous server Dai Ngo
2022-05-02 21:19 ` [PATCH RFC v25 7/7] NFSD: Show state of courtesy client in client info Dai Ngo
2022-05-03  1:12 ` [PATCH RFC v25 0/7] NFSD: Initial implementation of NFSv4 Courteous Server J. Bruce Fields
2022-05-03  1:21   ` J. Bruce Fields
2022-05-03  1:38     ` dai.ngo
2022-05-23 15:40       ` J. Bruce Fields [this message]
2022-05-23 16:57         ` 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=20220523154026.GD24163@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.