nfsd: allow for up to 32 callback session slots
authorJeff Layton <jlayton@kernel.org>
Mon, 18 Nov 2024 14:54:34 +0000 (09:54 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Tue, 19 Nov 2024 01:23:13 +0000 (20:23 -0500)
commit583772eec7b0096516a8ee8b1cc31401894f1e3a
treefdace5298c719e54018c626233bd3f6340e8d98d
parentc840b8e1f039e90f97ca55525667eb961422f86c
nfsd: allow for up to 32 callback session slots

nfsd currently only uses a single slot in the callback channel, which is
proving to be a bottleneck in some cases. Widen the callback channel to
a max of 32 slots (subject to the client's target_maxreqs value).

Change the cb_holds_slot boolean to an integer that tracks the current
slot number (with -1 meaning "unassigned").  Move the callback slot
tracking info into the session. Add a new u32 that acts as a bitmap to
track which slots are in use, and a u32 to track the latest callback
target_slotid that the client reports. To protect the new fields, add
a new per-session spinlock (the se_lock). Fix nfsd41_cb_get_slot to always
search for the lowest slotid (using ffs()).

Finally, convert the session->se_cb_seq_nr field into an array of
ints and add the necessary handling to ensure that the seqids get
reset when the slot table grows after shrinking.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4callback.c
fs/nfsd/nfs4state.c
fs/nfsd/state.h
fs/nfsd/trace.h