From: Chuck Lever <chuck.lever@oracle.com>
To: Mike Snitzer <snitzer@kernel.org>, Jeff Layton <jlayton@kernel.org>
Cc: NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <dai.ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] sunrpc: add an extra reserve page to svc_serv_maxpages()
Date: Wed, 10 Sep 2025 10:29:19 -0400 [thread overview]
Message-ID: <0ac2d8a9-1cb5-431b-a99b-695e20a8a6c0@oracle.com> (raw)
In-Reply-To: <20250909233315.80318-2-snitzer@kernel.org>
On 9/9/25 7:33 PM, Mike Snitzer wrote:
> nfsd_iter_read() might need two extra pages when a READ payload is not
> DIO-aligned -- but nfsd_iter_read() and nfsd_splice_actor() are
> mutually exclusive (so reuse page reserved for nfsd_splice_actor).
>
> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> ---
> include/linux/sunrpc/svc.h | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
> index e64ab444e0a7f..190c2667500e2 100644
> --- a/include/linux/sunrpc/svc.h
> +++ b/include/linux/sunrpc/svc.h
> @@ -163,10 +163,13 @@ extern u32 svc_max_payload(const struct svc_rqst *rqstp);
> * pages, one for the request, and one for the reply.
> * nfsd_splice_actor() might need an extra page when a READ payload
> * is not page-aligned.
> + * nfsd_iter_read() might need two extra pages when a READ payload
> + * is not DIO-aligned -- but nfsd_iter_read() and nfsd_splice_actor()
> + * are mutually exclusive (so reuse page reserved for nfsd_splice_actor).
> */
> static inline unsigned long svc_serv_maxpages(const struct svc_serv *serv)
> {
> - return DIV_ROUND_UP(serv->sv_max_mesg, PAGE_SIZE) + 2 + 1;
> + return DIV_ROUND_UP(serv->sv_max_mesg, PAGE_SIZE) + 2 + 1 + 1;
> }
>
> /*
I'm not convinced an additional page is necessary. The most the direct
I/O range can be is rsize + 1 page, AFAICT, and that seems to be covered
already.
If we want NFSD to support file systems / block devices with alignment
requirements large than a page, then perhaps additional buffer space
will be needed... or NFSD can return a short read.
--
Chuck Lever
next prev parent reply other threads:[~2025-09-10 14:29 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-09 19:05 [PATCH v1 0/3] NFSD direct I/O read Chuck Lever
2025-09-09 19:05 ` [PATCH v1 1/3] NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support Chuck Lever
2025-09-09 23:07 ` NeilBrown
2025-09-09 19:05 ` [PATCH v1 2/3] NFSD: pass nfsd_file to nfsd_iter_read() Chuck Lever
2025-09-09 23:20 ` NeilBrown
2025-09-09 19:05 ` [PATCH v1 3/3] NFSD: Implement NFSD_IO_DIRECT for NFS READ Chuck Lever
2025-09-09 23:16 ` Mike Snitzer
2025-09-09 23:37 ` NeilBrown
2025-09-09 23:39 ` Chuck Lever
2025-09-09 23:48 ` Chuck Lever
2025-09-10 1:54 ` NeilBrown
2025-09-10 1:52 ` NeilBrown
2025-09-10 14:23 ` Chuck Lever
2025-09-09 23:56 ` Mike Snitzer
2025-09-10 11:37 ` Jeff Layton
2025-09-09 23:33 ` [PATCH 0/2] NFSD: continuation of NFSD DIRECT Mike Snitzer
2025-09-09 23:33 ` [PATCH 1/2] sunrpc: add an extra reserve page to svc_serv_maxpages() Mike Snitzer
2025-09-10 14:29 ` Chuck Lever [this message]
2025-09-09 23:33 ` [PATCH 2/2] NFSD: Implement NFSD_IO_DIRECT for NFS WRITE Mike Snitzer
2025-10-08 18:59 ` [PATCH v2] " Mike Snitzer
2025-10-09 15:04 ` Jeff Layton
2025-10-09 17:46 ` Chuck Lever
2025-10-13 15:41 ` Mike Snitzer
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=0ac2d8a9-1cb5-431b-a99b-695e20a8a6c0@oracle.com \
--to=chuck.lever@oracle.com \
--cc=dai.ngo@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=snitzer@kernel.org \
--cc=tom@talpey.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