Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795929552; b=eFY9e9ojCD+s49wgG5AhE2osPfQ3cwnZqteqnmi+W+uV8sw7xpyNs3VjZ3UilKT+axF1 2+Q74BoWaBtfaY34tFBm/CiSB5pjGBHldheezafAJReC8UUDmQdgqMLuyPGR81+yxcYvo 3bqug4pgsduNxemiE5fIcXfJZS4vM8J0tQTQBqbCDiXqpQ84P0I43BDV5FLp1Wfv1gq8d Rw/iE+5yCSYk6RYrWOW8qh76w81U3V0ifo68jAQKusBFFsN64b+bZRi8F3OEc/VzhEb4K 8jb3PEy0FZPUd2tRzcku2EpUC6p17vvfEppf8pzhwDtfeE9Gdkd5vbvbQk3IMe4REHg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795929552; h=Received:DKIM-Signature:Message-ID:Subject:From:To:Cc:Date: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: User-Agent:MIME-Version; bh=kxGJpkFCWNCPdRDKmY6tLHJ/opCQKdESINB+L3BmrlQ=; b=RCSIQoVtQrkz5tvDPpJEgCy6Io4Q4TAmVjT8yMTkZef8l2fprmjNgksTYeczxW5Dwfkn IOKNJyUp/4VNHYv9OXLmqKKTtLbUME8XFF8w9L+4yo9sekqlSjAanpP9SdtV6tUbDGN91 knbT3Rtdr48gdinHwiGJjQRX6KMRAfe8TTunUFsRHqxzu8bK1ut/HeaTApWRn3Rliq3Xd Ea+8Gfj9hA27vDPyLlJ0jmHv7E2TEP0cyna370i82d6aL1afcqjVY1cQCtdMSI4TPKmHE CauhGwWkfLyxqifq6ndY4f002Xbi2jdr3zcUNiodmZ3kh1jtOiP+Gw4+OODB5/53ABQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JGHZjPuq; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E451C606A31C for ; Sun, 29 Nov 2026 05:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=JGHZjPuq Received: by smtp.kernel.org (Postfix) with ESMTPSA id E65AA1F00897; Sun, 29 Nov 2026 05:19:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795929551; bh=kxGJpkFCWNCPdRDKmY6tLHJ/opCQKdESINB+L3BmrlQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=JGHZjPuqaZM5wJQkW4ibdRvCmAzTM208x5ELfYUCJbEslSUAilp67pvCVwifzsVma BO22+vzVT6vH1FBffU1UDLd73iLi1wFvfDWlXPMc5Ial+HSccKqj5ETOUV+3a+dWCX xbygNVwliLDtc4McuhKthVwAA/TO/60vl9r05lFouwYnukXnsYEzQOh2xnCNJpEMdo WSi9fWJLGYOhVGrsJKP75Vr2STkpzzbQ0TCiUawFWZnTjzzYnQCWvlEAi5oc7RZ7rO o1FcM8CzGgk+Ik5+1lSR9FJaUX/xOgAsnVJ+emNvmq/mccdC7jx+B6dhwmDUcswGWH s7BJM5j0zpKCQ== Message-ID: Subject: Re: [PATCH v3 1/5] pNFS/flexfiles: use the MDS for locked-folio writeback without a layout From: Trond Myklebust To: Olga Kornievskaia Cc: Benjamin Coddington , Anna Schumaker , Mike Snitzer , linux-nfs@vger.kernel.org Date: Sun, 29 Nov 2026 00:19:09 -0500 In-Reply-To: References: <81fea5dcd8feebcf1590effad8b96648b288bb11.1795122900.git.bcodding@hammerspace.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.62.1 (3.62.1-1.fc45) X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Sat, 2026-11-28 at 21:04 -0500, Olga Kornievskaia wrote: >=20 >=20 > On Sat, Nov 28, 2026 at 7:11=E2=80=AFPM Trond Myklebust > wrote: > > On Fri, 2026-11-20 at 11:09 -0500, Benjamin Coddington wrote: > > > From: Benjamin Coddington > > >=20 > > > nfs_writepage_locked() writes back one folio that its caller > > > holds > > > locked, for nfs_wb_folio(), nfs_wb_folio_reclaim() and > > > migration.=C2=A0 > > > When > > > there is no layout segment and the file's layout header carries > > > FF_FLAGS_NO_IO_THRU_MDS, ff_layout_pg_get_mirror_count_write() > > > refuses > > > the write with -EAGAIN.=C2=A0 nfs_do_writepage() redirties the folio > > > and > > > returns the -EAGAIN, and nfs_wb_folio() passes it to > > > nfs_updatepage(), > > > nfs_flush_incompatible(), nfs_read_folio() and > > > nfs_launder_folio().=C2=A0 > > > A > > > read(2) or write(2) on a blocking file then fails with EAGAIN, > > > for > > > example when another open context has dirtied the same folio > > > while a > > > layout is being recalled. > > >=20 > > > Resending from nfs_wb_folio(), as nfs_writepages() does, would > > > hold > > > the > > > folio locked across the resends.=C2=A0 A bulk recall can't complete > > > while > > > nfs_writepages() holds a layout segment, and nfs_writepages() > > > would > > > be > > > waiting for that folio's lock. > > >=20 > > > FF_FLAGS_NO_IO_THRU_MDS is a hint (RFC 8435, section 5.1.2).=C2=A0 > > > Mark > > > the > > > descriptor that nfs_writepage_locked() uses with a new > > > pg_allow_mds > > > bit, and send its write through the MDS when there is no layout > > > segment.=C2=A0 When ff_layout_pg_init_write() can't use a data server= , > > > send > > > such a write to the MDS too, instead of retrying with the folio > > > locked. > > >=20 > > > ff_layout_pg_init_write() switches a write to the MDS by > > > resetting > > > the > > > descriptor and returning -EAGAIN, which nfs_wb_folio() also > > > passes > > > up, > > > with or without the flag.=C2=A0 When nfs_wb_folio() gets -EAGAIN, wai= t > > > for > > > any part of the folio already under writeback, as its loop does, > > > and > > > write the folio once more with a descriptor that goes straight to > > > the > > > MDS.=C2=A0 nfs_wb_folio_reclaim() still returns the error, and > > > nfs_release_folio() keeps the folio. > > >=20 > >=20 > > NACK. The spec is misleading, because it says "the client should > > not > > send I/O operations to the metadata server". That ought really to > > read > > as "the client SHOULD NOT send I/O operations to the metadata > > server". > >=20 > > I.e. it should be using the IETF normative language. > >=20 > > The point is that sending I/O though the MDS is likely to be > > detrimental to the overall functioning of the system, so don't do > > it! > >=20 >=20 >=20 > I believe at this point performance is not even considered. We are at > the state where IO isn't going thru DS and at this point it seems > like it should be advantageous to fallback to MDS to make any kind of > progress.=C2=A0 Definitely not! On a loosely coupled system, this just propagates the bottleneck to the metadata server, causing it to be a problem for all clients instead of just the few that are trying to do pNFS to the downed DS. >=20 > We ran into this problem during bakeathon=C2=A0(I might be hazy on some > details though). The client would get a layout from MDS to a DS but > the client couldn't actually connect to it. It would timeout then it > would try to get the layout again and eventually would get it again > pointing to the same DS and basically it looks like an infinite loop > because the client would see that it's instructed not to write the > MDS so it would keep going in circles. >=20 > >=20 This is precisely why we added the LAYOUTERROR op, and error reporting in LAYOUTRETURN; so that the client can report the problem, and the server can decide what to do about it. The latter can recall the layout if it was not already returned. When the client then asks for a new one, the server then has the option of returning NFS4ERR_LAYOUTUNAVAILABLE if it really wants to trigger a fall back to I/O through the MDS. --=20 Trond Myklebust Linux NFS client maintainer, Hammerspace trondmy@kernel.org, trond.myklebust@hammerspace.com