From: Jeff Layton <jlayton@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH 4/4] NFS: use a hash table for delegation lookup
Date: Tue, 15 Jul 2025 07:19:37 -0400 [thread overview]
Message-ID: <c7aec332813db8baca01c5a1b00d4853594c3f91.camel@kernel.org> (raw)
In-Reply-To: <20250715085844.GA21655@lst.de>
On Tue, 2025-07-15 at 10:58 +0200, Christoph Hellwig wrote:
> On Mon, Jul 14, 2025 at 09:14:27AM -0400, Jeff Layton wrote:
> > > + delegation_buckets = roundup_pow_of_two(nfs_delegation_watermark / 16);
> > > + server->delegation_hash_mask = delegation_buckets - 1;
> > > + server->delegation_hash_table = kmalloc_array(delegation_buckets,
> > > + sizeof(*server->delegation_hash_table), GFP_KERNEL);
> > > + if (!server->delegation_hash_table)
> > > + goto out_free_server;
> > > + for (i = 0; i < delegation_buckets; i++)
> > > + INIT_HLIST_HEAD(&server->delegation_hash_table[i]);
> > > +
> >
> > This is going to get created for any mount, even v3 ones. It might be
> > better to only bother with this for v4 mounts. Maybe do this in
> > nfs4_server_common_setup() instead?
>
> I tried that, but it crashes because the usual mount process goes
> through nfs_clone_server, which then doesn't set up the hash table.
>
> I think the best idea is to pass the version to nfs_allocate_server
> and just make this code conditional, but I'm open to other suggestions.
The other thing you could do is move the allocation and setup into a
helper function, and have nfs_clone_server() call that if the source
server has a hashtable present.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2025-07-15 11:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 11:16 use a hash for looking up delegation Christoph Hellwig
2025-07-14 11:16 ` [PATCH 1/4] NFS: cleanup nfs_inode_reclaim_delegation Christoph Hellwig
2025-07-14 13:06 ` Jeff Layton
2025-07-14 11:16 ` [PATCH 2/4] NFS: move the delegation_watermark module parameter Christoph Hellwig
2025-07-14 13:06 ` Jeff Layton
2025-07-15 8:03 ` Christoph Hellwig
2025-07-15 11:15 ` Jeff Layton
2025-07-14 11:16 ` [PATCH 3/4] NFS: track active delegations per-server Christoph Hellwig
2025-07-14 13:07 ` Jeff Layton
2025-07-14 11:16 ` [PATCH 4/4] NFS: use a hash table for delegation lookup Christoph Hellwig
2025-07-14 13:14 ` Jeff Layton
2025-07-14 13:18 ` Christoph Hellwig
2025-07-15 8:58 ` Christoph Hellwig
2025-07-15 11:19 ` Jeff Layton [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-07-16 13:26 use a hash for looking up delegation v2 Christoph Hellwig
2025-07-16 13:26 ` [PATCH 4/4] NFS: use a hash table for delegation lookup Christoph Hellwig
2025-07-17 4:35 ` kernel test robot
2025-07-17 5:13 ` Christoph Hellwig
2025-07-17 16:00 ` Trond Myklebust
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=c7aec332813db8baca01c5a1b00d4853594c3f91.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=anna@kernel.org \
--cc=hch@lst.de \
--cc=linux-nfs@vger.kernel.org \
--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