[PATCH v2 20/23] NFSv4/pnfs: Grow the deviceid cache hash table
Benjamin Coddington <[email protected]>
| Newsgroups | org.kernel.vger.linux-nfs |
|---|---|
| Message-ID | <b96440fcfa33e1f332c26c0e42133d05f51d532e.1787327939.git.bcodding@hammerspace.com> |
The global deviceid cache has 32 buckets shared by every server and layout type. Striping deployments initially anticipate device counts scaling to 1024 or more devices, which leaves those chains 32 entries deep for every resolution to walk. Grow to 256 buckets, four deep at that scale, for 2KB of BSS on 64-bit. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington <[email protected]> --- fs/nfs/pnfs_dev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/nfs/pnfs_dev.c b/fs/nfs/pnfs_dev.c index a3b28409539a..e8143977965c 100644 --- a/fs/nfs/pnfs_dev.c +++ b/fs/nfs/pnfs_dev.c @@ -40,8 +40,11 @@ /* * Device ID RCU cache. A device ID is unique per server and layout type. + * + * 256 buckets keeps the chains short at the 1024-or-more devices a + * striping deployment expects, for 2KB of BSS on 64-bit. */ -#define NFS4_DEVICE_ID_HASH_BITS 5 +#define NFS4_DEVICE_ID_HASH_BITS 8 #define NFS4_DEVICE_ID_HASH_SIZE (1 << NFS4_DEVICE_ID_HASH_BITS) #define NFS4_DEVICE_ID_HASH_MASK (NFS4_DEVICE_ID_HASH_SIZE - 1) -- 2.53.0