linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "J. Bruce Fields" <bfields@redhat.com>, linux-nfs@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Trond Myklebust <trondmy@hammerspace.com>,
	David Howells <dhowells@redhat.com>, Tejun Heo <tj@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>, Shaohua Li <shli@fb.com>,
	Oleg Nesterov <oleg@redhat.com>
Subject: Re: [PATCH 0/7] Eliminate delegation self-conflicts
Date: Sat, 09 Feb 2019 07:43:54 -0500	[thread overview]
Message-ID: <bbc264481c2368f1e7a386cafb0cd5fba6af7ecf.camel@redhat.com> (raw)
In-Reply-To: <1549656647-25115-1-git-send-email-bfields@redhat.com>

On Fri, 2019-02-08 at 15:10 -0500, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfields@redhat.com>
> 
> These patches allow NFSv4 clients holding delegations to keep them when
> the operation that would break a delegation comes from the same client.
> 
> To do that, we somehow need to pass the identity of the
> delegation-breaker down through the VFS.
> 
> This series uses the tgid, a solution suggested by Trond.  To do that we
> need nfsd tasks to share the same tgid.  I do that by extending the
> kthread code slightly to allow knfsd to run the kthreadd main loop in a
> task of its own, and spawn its server threads off of that task.
> 
> Part of Trond's thinking was that this would work for userspace too.
> Delegations are currently only available to knfsd, but Ganesha and Samba
> may eventually be interested in a userspace interface (probably a minor
> variation on the fcntl F_{GET,SET}LEASE interface).  A threaded
> userspace server would first resolve conflicts between its own clients,
> and then call into the kernel to break any leases acquired by other
> processes.  That may require some careful locking of the server's own
> data structures, but it should work.
> 
> Previously I considered instead adding a new field somewhere in the
> struct task.  That might require a new system call to expose to user
> space.  Or we might be able to put this in a keyring, if David Howells
> thought that would work.
> 
> Before that I tried passing the identity of the breaker explicitly, but
> that looks like it would require passing the new argument around to huge
> swaths of the VFS.
> 
> I'm testing this with some a locally modified pynfs; I'll fix that up
> and push it out at some point, but pynfs has a number of bugs in this
> area.
> 
> I wasn't sure who to ask about the kthread.c changes, so I'm cc'ing a
> random assortment of developers in recent changelogs, hope that's OK.
> 
> --b.
> 
> J. Bruce Fields (7):
>   kthreads: minor kthreadd refactoring
>   kthreads: Simplify tsk_fork_get_node
>   kthreads: allow multiple kthreadd's
>   kthreads: allow cloning threads with different flags
>   rpc: separate out body of svc_start_kthreads
>   rpc: move rpc server threads into their own thread group
>   nfsd: ignore delegation self-conflicts
> 
>  fs/locks.c                 |  39 +++++++++++
>  fs/nfsd/nfs4state.c        |  61 ++++++++++++++++
>  fs/nfsd/state.h            |   2 +
>  fs/nfsd/vfs.c              |  32 +++++++--
>  include/linux/fs.h         |   2 +
>  include/linux/kthread.h    |  21 +++++-
>  include/linux/sunrpc/svc.h |   1 +
>  init/init_task.c           |   3 +
>  init/main.c                |   4 +-
>  kernel/fork.c              |   4 ++
>  kernel/kthread.c           | 140 +++++++++++++++++++++++++++----------
>  net/sunrpc/svc.c           |  83 ++++++++++++++--------
>  12 files changed, 317 insertions(+), 75 deletions(-)
> 

Nice work! I like the basic idea, the changes seem to be well-organized, 
and the tgid semantics are clear and make sense.

Would this preclude us from moving to a workqueue-based model for knfsd
later? It's likely to still be worth it, but it'd be good to understand
the potential drawbacks.

Thanks,
-- 
Jeff Layton <jlayton@redhat.com>


  parent reply	other threads:[~2019-02-09 12:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 20:10 [PATCH 0/7] Eliminate delegation self-conflicts J. Bruce Fields
2019-02-08 20:10 ` [PATCH 1/7] kthreads: minor kthreadd refactoring J. Bruce Fields
2019-02-08 20:10 ` [PATCH 2/7] kthreads: Simplify tsk_fork_get_node J. Bruce Fields
2019-02-08 20:10 ` [PATCH 3/7] kthreads: allow multiple kthreadd's J. Bruce Fields
2019-03-12 20:01   ` J. Bruce Fields
2019-02-08 20:10 ` [PATCH 4/7] kthreads: allow cloning threads with different flags J. Bruce Fields
2019-02-08 20:10 ` [PATCH 5/7] rpc: separate out body of svc_start_kthreads J. Bruce Fields
2019-02-08 20:10 ` [PATCH 6/7] rpc: move rpc server threads into their own thread group J. Bruce Fields
2019-02-08 20:10 ` [PATCH 7/7] nfsd: ignore delegation self-conflicts J. Bruce Fields
2019-02-09 12:43 ` Jeff Layton [this message]
2019-02-11 15:58   ` [PATCH 0/7] Eliminate " J. Bruce Fields
2019-02-15 16:35     ` J. Bruce Fields

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=bbc264481c2368f1e7a386cafb0cd5fba6af7ecf.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=bfields@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=shli@fb.com \
    --cc=tj@kernel.org \
    --cc=trondmy@hammerspace.com \
    /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).