public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6 v3] nfsd: allocate/free session-based DRC slots on demand
@ 2024-12-06  0:43 NeilBrown
  2024-12-06  0:43 ` [PATCH 1/6] nfsd: use an xarray to store v4.1 session slots NeilBrown
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: NeilBrown @ 2024-12-06  0:43 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

Changes from v2:
 - number of slots is increased more quickly.  Every time the highest-number
   slot is used, we increase by at least 20%.
 - when xa_store() is used in a context where we no that no allocation can
   happen, pass '0' as the GFP flag.
 - report target slots as well as total slots in /proc/fs/nfsd/clients/*/info

I've stay with reporting session information in the client info file
rather than creating a directory or using netlink.  I think the client
info file is simple and adequate.

I still haven't added support for CB_RECALL_SLOT.  While it is helpful,
it isn't essential.  I'll probably try to add it after the current
series lands.

Thanks,
NeilBrown



^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/6 v5] nfsd: allocate/free session-based DRC slots on demand
@ 2024-12-11 21:47 NeilBrown
  2024-12-11 21:47 ` [PATCH 4/6] nfsd: allocate new " NeilBrown
  0 siblings, 1 reply; 23+ messages in thread
From: NeilBrown @ 2024-12-11 21:47 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

Differences from v4:
 - added Jeff's Reviewed-by - thanks.
 - fixed problem in final patch.  There are two places where a session can be
   detached from lists and both need to detach from the new global list.

Thanks,
NeilBrown

 [PATCH 1/6] nfsd: use an xarray to store v4.1 session slots
 [PATCH 2/6] nfsd: remove artificial limits on the session-based DRC
 [PATCH 3/6] nfsd: add session slot count to
 [PATCH 4/6] nfsd: allocate new session-based DRC slots on demand.
 [PATCH 5/6] nfsd: add support for freeing unused session-DRC slots
 [PATCH 6/6] nfsd: add shrinker to reduce number of slots allocated

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/6 v4] nfsd: allocate/free session-based DRC slots on demand
@ 2024-12-08 22:43 NeilBrown
  2024-12-08 22:43 ` [PATCH 4/6] nfsd: allocate new " NeilBrown
  0 siblings, 1 reply; 23+ messages in thread
From: NeilBrown @ 2024-12-08 22:43 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

Changes from v3 include:
 - use GFP_NOWAIT more consistently - don't use GFP_ATOMIC
 - document reduce_session_slots()
 - change sl_generation to u16.  As we reduce the number of slots one at
   a time and update se_slot_gen each time, we could cycle a u8 generation
   counter quickly.

Thanks,
NeilBrown

 [PATCH 1/6] nfsd: use an xarray to store v4.1 session slots
 [PATCH 2/6] nfsd: remove artificial limits on the session-based DRC
 [PATCH 3/6] nfsd: add session slot count to
 [PATCH 4/6] nfsd: allocate new session-based DRC slots on demand.
 [PATCH 5/6] nfsd: add support for freeing unused session-DRC slots
 [PATCH 6/6] nfsd: add shrinker to reduce number of slots allocated

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/6 RFC v2] nfsd: allocate/free session-based DRC slots on demand
@ 2024-11-19  0:41 NeilBrown
  2024-11-19  0:41 ` [PATCH 4/6] nfsd: allocate new " NeilBrown
  0 siblings, 1 reply; 23+ messages in thread
From: NeilBrown @ 2024-11-19  0:41 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton
  Cc: linux-nfs, Olga Kornievskaia, Dai Ngo, Tom Talpey

Here is v2 of my series for on-demand allocation and freeing of session DRC slots.

- Now uses an xarray to store slots, and the limit is raised to 2048
- delays retiring a slot until the client has confirmed that it isn't
  using it as described in RFC:

      The replier SHOULD retain the slots it wants to retire until the
      requester sends a request with a highest_slotid less than or equal
      to the replier's new enforced highest_slotid.

- When a retired slot is used, allow the seqid to be the next in sequence
  as required by the RFC:

         Each time a slot is reused, the request MUST specify a sequence
         ID that is one greater than that of the previous request on the
         slot.

  or "1" as (arguably) allowed by the RFC:

         The first time a slot is used, the requester MUST specify a
         sequence ID of one

- current slot allocation is now reported in /proc/fs/nfsd/clients/*/info

This has been tested with highly aggressive shrinker settings:
	nfsd_slot_shrinker->seeks = 0;
	nfsd_slot_shrinker->batch = 2;

and with periodic "echo 3 > drop_caches".  The slot count drops as
expected and then increases again.

NeilBrown



^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2024-12-11 21:49 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06  0:43 [PATCH 0/6 v3] nfsd: allocate/free session-based DRC slots on demand NeilBrown
2024-12-06  0:43 ` [PATCH 1/6] nfsd: use an xarray to store v4.1 session slots NeilBrown
2024-12-06  0:43 ` [PATCH 2/6] nfsd: remove artificial limits on the session-based DRC NeilBrown
2024-12-06  0:43 ` [PATCH 3/6] nfsd: add session slot count to /proc/fs/nfsd/clients/*/info NeilBrown
2024-12-06  0:43 ` [PATCH 4/6] nfsd: allocate new session-based DRC slots on demand NeilBrown
2024-12-06  1:04   ` Jeff Layton
2024-12-06  1:43     ` NeilBrown
2024-12-06 13:49       ` Jeff Layton
2024-12-06 20:51   ` Chuck Lever
2024-12-08  4:52     ` NeilBrown
2024-12-06  0:43 ` [PATCH 5/6] nfsd: add support for freeing unused session-DRC slots NeilBrown
2024-12-06  5:30   ` Jeff Layton
2024-12-06  6:05     ` NeilBrown
2024-12-06 13:59       ` Jeff Layton
2024-12-06  0:43 ` [PATCH 6/6] nfsd: add shrinker to reduce number of slots allocated per session NeilBrown
  -- strict thread matches above, loose matches on Subject: below --
2024-12-11 21:47 [PATCH 0/6 v5] nfsd: allocate/free session-based DRC slots on demand NeilBrown
2024-12-11 21:47 ` [PATCH 4/6] nfsd: allocate new " NeilBrown
2024-12-08 22:43 [PATCH 0/6 v4] nfsd: allocate/free " NeilBrown
2024-12-08 22:43 ` [PATCH 4/6] nfsd: allocate new " NeilBrown
2024-11-19  0:41 [PATCH 0/6 RFC v2] nfsd: allocate/free " NeilBrown
2024-11-19  0:41 ` [PATCH 4/6] nfsd: allocate new " NeilBrown
2024-11-19 19:20   ` Chuck Lever
2024-11-19 22:27     ` NeilBrown
2024-11-20  0:32       ` Chuck Lever
2024-11-21 21:20         ` NeilBrown
2024-11-19 19:34   ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox