public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] New dcache / inode hash tuning patch
Date: Sat, 1 Mar 2003 18:34:52 +0000 (UTC)	[thread overview]
Message-ID: <b3qugc$3kt$1@penguin.transmeta.com> (raw)
In-Reply-To: 20030301043131.7D5301058@oscar.casa.dyndns.org

In article <20030301043131.7D5301058@oscar.casa.dyndns.org>,
Ed Tomlinson  <tomlins@cam.org> wrote:
>
>I wonder what would happen if you reordered the chains moving a 'found'
>dentry to the front of the chain?  If this could be done without 
>excessive locking it might help keep hot entries quickly accessable.

The original dentry code actually did that. It sucks.

The reason it sucks is not so much just the locking, but the fact that
you dirty the cache lines, which means that not only are you blowing
your cache on that CPU, you also caused the other CPU's to blow _their_
caches (the lines that are in the cache can no longer be shared) AND you
caused excessive bus traffic for the writeouts. 

In other words: it makes sense if there is one or two really hot
entries.  But it does not make sense in general.  But you might have
some heuristic that does it "every 1000 lookups" or something like that,
to avoid the problems but still statistically getting the really hot
entries closer to the top. 

This cache behaviour is, btw, something that rcu made worse - with the
pre-rcu stuff, we avoided taking the dcache locks and incrementing the
dcache counters for intermediate cached lookups, and we only did it for
the leaf entry (or misses). 

I hope that we can re-do that optimization _with_ rcu in 2.7.x.

		Linus

  parent reply	other threads:[~2003-03-01 18:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030226164904.GA21342@wotan.suse.de.suse.lists.linux.kernel>
     [not found] ` <b3m5sd$1ad$1@penguin.transmeta.com.suse.lists.linux.kernel>
2003-02-28  8:34   ` [PATCH] New dcache / inode hash tuning patch Andi Kleen
2003-02-28 10:27     ` [Lse-tech] " Paul Menage
2003-02-28 10:40       ` Andi Kleen
2003-02-28 18:47     ` Linus Torvalds
2003-02-28 18:59       ` Andi Kleen
2003-03-01  0:49         ` Jan Harkes
2003-03-01  1:17           ` Andi Kleen
2003-03-01  4:31             ` Ed Tomlinson
2003-03-01  9:08               ` Andi Kleen
2003-03-01 12:34                 ` Ed Tomlinson
2003-03-01 18:34               ` Linus Torvalds [this message]
2003-02-26 16:49 Andi Kleen
2003-02-27 23:10 ` Linus Torvalds

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='b3qugc$3kt$1@penguin.transmeta.com' \
    --to=torvalds@transmeta.com \
    --cc=linux-kernel@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