From: Christoph Hellwig <hch@infradead.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
bfields@fieldses.org, gartim@gmail.com,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfsd: when reusing an existing repcache entry, unhash it first
Date: Wed, 4 Dec 2013 00:33:36 -0800 [thread overview]
Message-ID: <20131204083336.GB30216@infradead.org> (raw)
In-Reply-To: <20131203132112.1f19c014@tlielax.poochiereds.net>
On Tue, Dec 03, 2013 at 01:21:12PM -0500, Jeff Layton wrote:
> Most of this code is protected by a single spinlock (cache_lock). The
> main benefit to switching to list_lru would be that we could move to a
> per-node lock. But, to make that worthwhile would mean we'd need to
> redesign the locking and break the cache_lock into multiple locks.
No need to redo locks just yet, the biggest benefit is to use a well
debug library for lru list handling, with the second biggest one being
that you get out of the box shrinker support.
> Also, the existing code does take pains to reuse an expired entry off
> the LRU list in preference to allocating a new one. The list_lru code
> doesn't have a mechanism to scrape the first entry off the LRU list,
> though I suppose we could add one or abuse the cb_arg in the walk
> callback as a return pointer.
That's just because it is an old-school cache with a fixed upper bound
of entries and no shrinker support. With proper shrinker integration
this nasty code isn't needed.
next prev parent reply other threads:[~2013-12-04 8:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-02 20:26 [PATCH] nfsd: when reusing an existing repcache entry, unhash it first Jeff Layton
2013-12-03 10:25 ` Christoph Hellwig
2013-12-03 18:21 ` Jeff Layton
2013-12-04 8:33 ` Christoph Hellwig [this message]
2013-12-04 12:54 ` Jeff Layton
2013-12-04 13:09 ` Christoph Hellwig
2013-12-04 13:31 ` Jeff Layton
2013-12-04 13:40 ` Christoph Hellwig
2013-12-04 13:45 ` Jeff Layton
2013-12-04 13:54 ` Christoph Hellwig
2013-12-04 14:15 ` Jeff Layton
2013-12-04 14:25 ` J. Bruce Fields
2013-12-04 17:06 ` Jeff Layton
2013-12-04 17:06 ` Christoph Hellwig
2013-12-04 18:43 ` Jeff Layton
2013-12-03 15:50 ` J. Bruce Fields
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=20131204083336.GB30216@infradead.org \
--to=hch@infradead.org \
--cc=bfields@fieldses.org \
--cc=gartim@gmail.com \
--cc=jlayton@redhat.com \
--cc=linux-nfs@vger.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;
as well as URLs for NNTP newsgroup(s).