public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel@vger.kernel.org, Alexander Viro <viro@math.psu.edu>
Subject: Re: negative dentries wasting ram
Date: Fri, 24 May 2002 17:54:17 +0200	[thread overview]
Message-ID: <20020524155417.GP21164@dualathlon.random> (raw)
In-Reply-To: <20020524071657.GI21164@dualathlon.random> <Pine.LNX.4.44.0205240737400.26171-100000@home.transmeta.com>

On Fri, May 24, 2002 at 07:43:32AM -0700, Linus Torvalds wrote:
> 
> 
> On Fri, 24 May 2002, Andrea Arcangeli wrote:
> >
> > Negative dentries should be only temporary entities, for example between
> > the allocation of the dentry and the create of the inode, they shouldn't
> > be left around waiting the vm to collect them.
> 
> Wrong. Negative dentries are very useful for caching negative lookups:
> look at the average startup sequence of any program linked with glibc, and

yep I know it is a flood of enoent.

> depending on your setup you will notice how it tries to open a _lot_ of a
> files that do not exist (the "depending on your setup" comes from the fact
> that it depends on things like how quickly it finds your "locale" setup
> from its locale path - you may have one of the setups that puts it in the
> first location glibc searches etc).
> 
> If you don't cache those negative lookups, you will do a low-level
> filesystem lookup for each of those failures, which is _expensive_.

I see now the point, so they cache the information that there's no entry :).

> However, you're right that it probably doesn't help to do this after
> "unlink()" - it's probably only worth doing when actually doing a

Agreed, they should be dropped after unlink, and also if creat fails, so
I think my patch fits perfectly into the vfs caching scheme, the
negative dentries still will be generated for the costantly failed
lookups, but not on after unlink and creat-failures.

> "lookup()" that fails.
> 
> 		Linus
> 


Andrea

  parent reply	other threads:[~2002-05-24 15:57 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-24  7:16 negative dentries wasting ram Andrea Arcangeli
2002-05-24  8:10 ` Andreas Dilger
2002-05-24 15:36   ` Andrea Arcangeli
2002-05-24 16:12     ` Alexander Viro
2002-05-24 16:21       ` Andrea Arcangeli
2002-05-24 16:24         ` Alexander Viro
2002-05-24 14:43 ` Linus Torvalds
2002-05-24 14:51   ` David S. Miller
2002-05-24 14:53   ` Jakub Jelinek
2002-05-24 20:44     ` David Schwartz
2002-05-25 17:33     ` Florian Weimer
2002-05-24 15:54   ` Andrea Arcangeli [this message]
2002-05-24 16:22   ` Alexander Viro
2002-05-24 16:29     ` Linus Torvalds
2002-05-24 16:39       ` Andrea Arcangeli
2002-05-24 17:04         ` Alexander Viro
2002-05-24 17:06           ` Alexander Viro
2002-05-24 17:55           ` Andrea Arcangeli
2002-05-24 18:00             ` Alexander Viro
2002-05-24 18:58               ` Andrea Arcangeli
2002-05-24 19:04                 ` Alexander Viro
2002-05-24 19:43                   ` Andrea Arcangeli
2002-05-24 19:55                     ` Alexander Viro
2002-05-24 20:36                       ` Andrea Arcangeli
2002-05-24 22:14                         ` Jan Harkes
2002-05-24 22:31                           ` Andrea Arcangeli
2002-05-26  8:06             ` Eric W. Biederman
2002-05-24 17:00       ` Alexander Viro
2002-05-24 18:36         ` Mark Mielke
2002-05-31  8:34 ` Oliver Neukum

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=20020524155417.GP21164@dualathlon.random \
    --to=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /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