diff options
| author | Olga Kornievskaia <okorniev@redhat.com> | 2026-11-06 22:12:32 -0500 |
|---|---|---|
| committer | Anna Schumaker <anna.schumaker@hammerspace.com> | 2026-11-10 14:34:32 -0500 |
| commit | 4fdc29eb6730207b4a6f63f81575c7aa5c2a4ff1 (patch) | |
| tree | 33dcad299cb8b49fc2578697360a1467f6cb4645 /tools/perf/scripts/python/bin | |
| parent | e8433473eca284bc561373d0a0fff632f76aa594 (diff) | |
NFSv4: remember that the server may send CB_NOTIFY_LOCK
Two processes contending for a POSIX lock on one file see occasional
acquisitions of almost exactly 1, 3 or 7 seconds when the client holds a
delegation, although the holder releases within microseconds.
nfs4_retry_setlk() only parks a waiter on clp->cl_lock_waitq when
NFS_STATE_MAY_NOTIFY_LOCK is set. Otherwise it uses
nfs4_retry_setlk_simple(), which has no waitqueue at all and sleeps on a
bare timeout starting at NFS4_LOCK_MINTIMEOUT and doubling, so a waiter
that loses one poll waits a second, then two, then four.
NFS_STATE_MAY_NOTIFY_LOCK is set in _nfs4_open_and_get_state() from the
OPEN reply rflags. It describes the server, but is recorded per
nfs4_state and can only be learned from a reply. Once a delegation is
held, further opens are satisfied from it with no OPEN on the wire, so
o_res.rflags is zero and the new state starts out believing no callback
can arrive, even though the open that obtained the delegation was told
otherwise.
Record the capability on the nfs_client the first time an OPEN reply
carries it, and apply it to every state built for that client.
nfs_client is the right scope: the flag describes one server,
CB_NOTIFY_LOCK arrives on that client's backchannel, and cl_lock_waitq
is per nfs_client.
This also covers a case the per-state flag misses. After the delegation
is recalled the state has neither NFS_DELEGATED_STATE nor
NFS_STATE_MAY_NOTIFY_LOCK, so locks go to the server and the server does
send CB_NOTIFY_LOCK, but the client is in the backoff loop and ignores
it.
Fixes: a8ce377a5db8 ("nfs: track whether server sets MAY_NOTIFY_LOCK flag")
Assisted-by: Claude Opus 5
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
