mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chuck Lever" <cel@kernel.org>
To: daejun7.park@samsung.com
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>,
	"Benjamin Coddington" <bcodding@redhat.com>,
	"Trond Myklebust" <trondmy@kernel.org>,
	"Anna Schumaker" <anna@kernel.org>,
	linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/6] nfsd: layout recall and lease break fixes
Date: Tue, 06 Oct 2026 15:46:40 -0400	[thread overview]
Message-ID: <63ef8d7c-086f-4cc8-84bb-72c1b23bf596@slotpi15m67> (raw)
In-Reply-To: <20261006-nfsd-layout-recall-v1-0-b59b31caf342@samsung.com>

Hi Daejun,

An nfsd thread must not block for more than a few milliseconds, and
never on something a client controls. A client can tie up thread
after thread until the server has no more threads to respond to
LAYOUTRETURN or DELEGRETURN, and then the server deadlocks.

For delegations we are safe. nfsd_open_break_lease() passes
O_NONBLOCK and the operation returns NFS4ERR_DELAY.

For layouts we are not. A WRITE or SETATTR goes into XFS,
xfs_break_leased_layouts() calls break_layout() blocking, and the
nfsd thread sleeps in __break_lease() until the lease is dropped or
the breaker times out. That dates from f52792f484ba, but it was
bounded by fs.lease-break-time, and a Linux client from v6.8 on
rarely hit it. It responded OLD_STATEID, the callback failed, the
lease was dropped, and the thread was back within a round trip.

This series makes that wait the common case and then unbounded.

- Patch 3 polls on OLD_STATEID, so the thread sleeps for as long as
  the client takes to drain its I/O, up to lease-break-time.

- Patch 2 waits on the fence script with UMH_WAIT_PROC while
  lm_breaker_timedout() keeps returning false, so the thread waits
  lease-break-time plus however long the script takes to reach the
  client.

- Patch 5 extends the wait of patch 3 to a client past the seqid.

I think the fix has to come first. Before the WRITE or SETATTR, call
break_layout() non-blocking to start the recall, and return
NFS4ERR_DELAY on -EWOULDBLOCK, as we do for delegations. Then the
fence worker and the poll loop can take as long as they need and no
nfsd thread waits on them.

Give that a try and let me know if that works or needs improvement.


-- 
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)

  parent reply	other threads:[~2026-10-06 19:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06  4:29 Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 1/6] nfsd: make the time limit of a layout recall work Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 2/6] nfsd: run the fence script when a block layout lease break times out Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 3/6] nfsd: keep polling a layout recall answered with NFS4ERR_OLD_STATEID Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 4/6] nfsd: fail a LAYOUTGET in progress when the layout lease is broken Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 5/6] nfsd: poll a layout recall with a new seqid when the client is past it Daejun Park via B4 Relay
2026-10-06  4:29 ` [PATCH 6/6] nfsd: do not fence a client for a layout recall with no layouts left Daejun Park via B4 Relay
2026-10-06 19:46 ` Chuck Lever [this message]
     [not found] ` <CGME20261006194708epcas2p2df158d7a6f0f9eb57cf1f6c3a0ec0c4b@epcms2p1>
2026-10-07  2:10   ` RE:(2) [PATCH 0/6] nfsd: layout recall and lease break fixes Daejun Park

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=63ef8d7c-086f-4cc8-84bb-72c1b23bf596@slotpi15m67 \
    --to=cel@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=bcodding@redhat.com \
    --cc=daejun7.park@samsung.com \
    --cc=hch@lst.de \
    --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®