Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 1998 10:34:16 +0100
From:      "Stephen C. Tweedie" <sct@redhat.com>
To:        poipoi@famipow.com
Cc:        freebsd-fs@FreeBSD.ORG, linux-fsdevel@vger.rutgers.edu
Subject:   Re: name cache wiping in readdir ?
Message-ID:  <199808240934.KAA21958@dax.dcs.ed.ac.uk>
In-Reply-To: <19980823082102.396.qmail@hwi.poi.org>
References:  <19980823082102.396.qmail@hwi.poi.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Sun, 23 Aug 1998 10:21:01 +0200 (MET DST), poipoi@famipow.com said:

> 	hi
> in ext2, each name read by readdir (called by getdents(2)) is sent in
> the name cache. This can result of a cache wiping (i.e. cache 
> flushed to store useless new names).

> is it a good policy ? some statistics/study are available ?

There are very many programs which take directory listings and then
perform some operation (open, stat etc.) on each file.  Think about
doing "ls -l" or "grep *".  Adding the readdir results to the name cache
is a definite win here.

One thing which I would like to try (we did it in earlier versions of
the primitive name cache in 2.0) is a two-level name cache, where we
promote names up to the next level on a hit and demote them when we want
to emply a list.  The primary win of such a scheme is that names which
are only hit once never make it out of the first level of the cache, but
names which are genuinely useful (hit at least twice) get promoted and
hence get protected from the flushing effects of a mass "find"
operation.

It would be useful at some point to benchmark the effects of such a
change, but that will definitely have to be a 2.3 thing.  Just how
effective it would be would depend enormously on the pattern of load; in
general, the current scheme works pretty well.

--Stephen


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-fs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808240934.KAA21958>