From: "Chuck Lever" <cel@kernel.org>
To: "Jeff Layton" <jlayton@kernel.org>,
"Chuck Lever" <chuck.lever@oracle.com>,
NeilBrown <neil@brown.name>,
"Olga Kornievskaia" <okorniev@redhat.com>,
"Dai Ngo" <Dai.Ngo@oracle.com>, "Tom Talpey" <tom@talpey.com>,
"Trond Myklebust" <trondmy@kernel.org>,
"Anna Schumaker" <anna@kernel.org>
Cc: "Benjamin Coddington" <bcodding@hammerspace.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] nfsd/sunrpc: add svc_rqst->rq_private pointer and remove rq_lease_breaker
Date: Tue, 13 Jan 2026 14:21:06 -0500 [thread overview]
Message-ID: <5806015a-ad18-4bc9-a320-2fdab4d86969@app.fastmail.com> (raw)
In-Reply-To: <20260113-rq_private-v1-1-88ed308364e6@kernel.org>
On Tue, Jan 13, 2026, at 1:37 PM, Jeff Layton wrote:
> diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
> index eee8c3f4a251a3fae6e41679de0ec34c76caf198..8ce366c9e49220e8baf475c2e5f3424fedc1cec1 100644
> --- a/fs/nfsd/nfssvc.c
> +++ b/fs/nfsd/nfssvc.c
> @@ -900,6 +900,7 @@ nfsd(void *vrqstp)
> struct svc_xprt *perm_sock = list_entry(rqstp->rq_server->sv_permsocks.next, typeof(struct svc_xprt), xpt_list);
> struct net *net = perm_sock->xpt_net;
> struct nfsd_net *nn = net_generic(net, nfsd_net_id);
> + struct nfsd_thread_local_info ntli = { };
> bool have_mutex = false;
>
> /* At this point, the thread shares current->fs
> @@ -914,6 +915,8 @@ nfsd(void *vrqstp)
>
> set_freezable();
>
> + rqstp->rq_private = &ntli;
> +
> /*
> * The main request loop
> */
Thanks for tackling this one. Nits below...
This assumes sizeof(structure nfsd_thread_local_info) will always
be small enough that it is reasonable to keep on the stack. I
can't say that would be a good bet in the long run.
And we don't need the perfect reliability of not doing a dynamic
allocation here. If kmalloc(sizeof(struct nfsd_thread_local_info))
fails, the thread exits immediately, no harm.
Also, scatter-gather lists could not be stored directly in this
object because it is on the stack. If Ben wanted to stick a
32-byte buffer in struct nfsd_thread_local_info to be used with
the crypto API, it would have to be a pointer to it, not the
buffer itself.
Chuck Lever
next prev parent reply other threads:[~2026-01-13 19:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 18:37 [PATCH 0/2] nfsd/sunrpc: fix up some layering violations Jeff Layton
2026-01-13 18:37 ` [PATCH 1/2] nfsd/sunrpc: add svc_rqst->rq_private pointer and remove rq_lease_breaker Jeff Layton
2026-01-13 19:21 ` Chuck Lever [this message]
2026-01-13 19:31 ` Jeff Layton
2026-01-13 19:41 ` Chuck Lever
2026-01-13 20:12 ` Jeff Layton
2026-01-13 21:09 ` Chuck Lever
2026-01-13 18:37 ` [PATCH 2/2] nfsd/sunrpc: move rq_cachetype into struct nfsd_thread_local_info Jeff Layton
2026-01-13 18:53 ` [PATCH 0/2] nfsd/sunrpc: fix up some layering violations Benjamin Coddington
2026-01-14 19:33 ` Chuck Lever
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=5806015a-ad18-4bc9-a320-2fdab4d86969@app.fastmail.com \
--to=cel@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=bcodding@hammerspace.com \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
--cc=trondmy@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
all inboxes | Powered by JetHome®