From: Daejun Park <daejun7.park@samsung.com>
To: Chuck Lever <cel@kernel.org>
Cc: Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Christoph Hellwig <hch@lst.de>, Carlos Maiolino <cem@kernel.org>,
Amir Goldstein <amir73il@gmail.com>,
"Darrick J. Wong" <djwong@kernel.org>,
Dave Chinner <dgc@kernel.org>,
Sergey Bashirov <sergeybashirov@gmail.com>,
Christian Brauner <brauner@kernel.org>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Daejun Park <daejun7.park@samsung.com>
Subject: RE:(2) [PATCH 8/8] nfsd: get all extents of a block layout in one ->map_blocks call
Date: Mon, 12 Oct 2026 11:49:36 +0900 [thread overview]
Message-ID: <20261012024936epcms2p167798df55a23e5505a4c2f9d8b71f452@epcms2p1> (raw)
In-Reply-To: <235ae19b-fd63-4d01-9fe0-d047a33b55ed@slotpi15m67>
On Thu, Oct 08, 2026 at 12:44:33PM -0400, Chuck Lever wrote:
> nr_extents_max is bounded by PAGE_SIZE so that the per-request buffer
> stays small. But a struct iomap is nearly twice the size of an encoded
> extent, so this array is nearly twice the layout buffer it sits next
> to. On 64 KiB pages that is well over 100 KiB of physically contiguous
> memory per LAYOUTGET. A failure here turns into NFS4ERR_DELAY for
> every request under fragmentation.
>
> Using kvmalloc_array() would cover the large case, or you could cap
> nr_extents_max independently of PAGE_SIZE.
I will use kvmalloc_array() in v2.
> Passing write only when loga_minlength is non-zero, and having
> nfsd4_block_iomap_to_extent() refuse IOMAP_HOLE for IOMODE_RW the way
> it already refuses IOMAP_UNWRITTEN, gives the client the same answer
> without allocating anything. Admittedly this is a pre-existing
> issue -- perhaps a pre-requisite fix for this series is best, so
> that the fix can be backported to LTS.
Agreed, I will post it against nfsd-testing as a separate patch. It goes
back to commit 8c3ad9cb7343 ("nfsd/blocklayout: accept any minlength"),
which removed the check that refused a minlength below the block size.
With pynfs as the client on nfsd-testing, an RW LAYOUTGET for 0+1 MiB
with a minlength of zero on an empty file got NFS4ERR_LAYOUTUNAVAILABLE
and left 1 MiB allocated. With the change you describe it gets the same
error and nothing is allocated, and one for 64 KiB of written data is
still granted as READ_WRITE_DATA. v2 of this patch will take the same
change.
> A note about process: the series touches XFS and exportfs. It will
> need to go through the VFS tree, I think, and might conflict with
> what's already in nfsd-testing.
Patch 1 is now in xfs for-next (e3c682dd1130), and patch 8 builds on
170b788af22d in nfsd-testing, so patches 4 to 8 depend on both trees.
I will post them again after the merge window, rebased on -rc1, for the
VFS tree. Patches 2 and 3 are XFS fixes on their own and apply to xfs
for-next as they are, so they can go through the XFS tree before that
if Carlos wants them.
prev parent reply other threads:[~2026-10-12 2:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 1:39 [PATCH 0/8] xfs, nfsd: map a whole pNFS " Daejun Park via B4 Relay
2026-10-08 1:39 ` [PATCH 1/8] xfs: map pNFS layouts to the end of the extent again Daejun Park via B4 Relay
2026-10-08 1:39 ` [PATCH 2/8] xfs: refuse a direct allocation whose block reservation would wrap Daejun Park via B4 Relay
2026-10-08 15:40 ` Darrick J. Wong
[not found] ` <CGME20261008154023epcas2p487b78abba35fdc6d75f9dd8d62a39837@epcms2p1>
2026-10-12 2:47 ` Daejun Park
2026-10-08 1:39 ` [PATCH 3/8] xfs: clamp the pNFS layout range to the maximum file size Daejun Park via B4 Relay
2026-10-08 15:41 ` Darrick J. Wong
2026-10-08 1:39 ` [PATCH 4/8] exportfs: let ->map_blocks return more than one mapping Daejun Park via B4 Relay
2026-10-08 1:39 ` [PATCH 5/8] xfs: factor the mapping of one pNFS extent out of xfs_fs_map_blocks() Daejun Park via B4 Relay
2026-10-08 1:39 ` [PATCH 6/8] xfs: take the invalidate lock while mapping a pNFS layout Daejun Park via B4 Relay
2026-10-08 1:39 ` [PATCH 7/8] xfs: map the whole range of a pNFS layout in one ->map_blocks call Daejun Park via B4 Relay
2026-10-08 16:37 ` Chuck Lever
[not found] ` <CGME20261008163812epcas2p120bb86754876aa75cd744bd63258c465@epcms2p7>
2026-10-12 2:48 ` Daejun Park
2026-10-12 14:26 ` (2) " Chuck Lever
2026-10-08 1:39 ` [PATCH 8/8] nfsd: get all extents of a block " Daejun Park via B4 Relay
2026-10-08 16:44 ` Chuck Lever
[not found] ` <CGME20261008164459epcas2p313b027cb2807a94a05edb388633152ed@epcms2p1>
2026-10-12 2:49 ` Daejun Park [this message]
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=20261012024936epcms2p167798df55a23e5505a4c2f9d8b71f452@epcms2p1 \
--to=daejun7.park@samsung.com \
--cc=Dai.Ngo@oracle.com \
--cc=amir73il@gmail.com \
--cc=brauner@kernel.org \
--cc=cel@kernel.org \
--cc=cem@kernel.org \
--cc=dgc@kernel.org \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=sergeybashirov@gmail.com \
--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
all inboxes | Powered by JetHome®