All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH RFC 1/3] nfsd: don't try to reuse an expired DRC entry off the list
Date: Thu, 5 Dec 2013 10:50:24 -0500	[thread overview]
Message-ID: <20131205155024.GC30113@fieldses.org> (raw)
In-Reply-To: <20131205084156.5a9a2545@tlielax.poochiereds.net>

On Thu, Dec 05, 2013 at 08:41:56AM -0500, Jeff Layton wrote:
> On Thu, 5 Dec 2013 05:29:19 -0800
> Christoph Hellwig <hch@infradead.org> wrote:
> 
> > On Thu, Dec 05, 2013 at 06:00:51AM -0500, Jeff Layton wrote:
> > > Currently when we are processing a request, we try to scrape an expired
> > > or over-limit entry off the list in preference to allocating a new one
> > > from the slab.
> > > 
> > > This is unnecessarily complicated. Just use the slab layer.
> > 
> > I really don't think pruning caches from lookup functions is a good
> > idea. To many chances for locking inversions, unbounded runtime and
> > other issues.  So I'd prefer my earlier version of the patch to
> > remove it entirely if we want to change anything beyond your minimal
> > fix.
> > 
> 
> It's not likely to hit a locking inversion here since we don't have a
> lot of different locks, but point taken...
> 
> If we take that out, then that does mean that the cache may grow larger
> than the max...possibly much larger since the pruner workqueue job
> only runs every 120s and you can put a lot more entries into the cache
> in that period.

Yeah, this scares me.

I looked through my old mail but couldn't find your previous results:
how long did you find the hash buckets needed to be before the
difference was noticeable on your setup?

We typically do a failed-lookup-and-insert on every cached operation so
I wouldn't be surprised if a workload of small random writes, for
example, could produce an unreasonably large cache in that time.

--b.

> 
> That said, I don't feel too strongly about it, so if you think leaving
> it to the workqueue job and the shrinker is the right thing to do, then
> so be it.
> 
> -- 
> Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2013-12-05 15:50 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-05 11:00 [PATCH RFC 0/3] nfsd: convert nfsd DRC code to use list_lru infrastructure Jeff Layton
2013-12-05 11:00 ` [PATCH RFC 1/3] nfsd: don't try to reuse an expired DRC entry off the list Jeff Layton
2013-12-05 13:29   ` Christoph Hellwig
2013-12-05 13:41     ` Jeff Layton
2013-12-05 15:50       ` J. Bruce Fields [this message]
2013-12-05 16:22         ` Jeff Layton
2013-12-05 11:00 ` [PATCH RFC 2/3] list_lru: add a new LRU_SKIP_REST lru_status value and handling Jeff Layton
2013-12-05 13:30   ` Christoph Hellwig
2013-12-05 13:36     ` Jeff Layton
2013-12-05 11:00 ` [PATCH RFC 3/3] nfsd: convert DRC code to use list_lru Jeff Layton
2013-12-05 13:41   ` Christoph Hellwig
2013-12-05 13:48     ` Jeff Layton
2013-12-05 15:58       ` J. Bruce Fields
2013-12-11 16:31         ` J. Bruce Fields
2013-12-05 13:27 ` [PATCH RFC 0/3] nfsd: convert nfsd DRC code to use list_lru infrastructure Christoph Hellwig
2013-12-05 13:37   ` Jeff Layton

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=20131205155024.GC30113@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=hch@infradead.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.