From owner-freebsd-fs Mon Aug 24 06:09:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA23064 for freebsd-fs-outgoing; Mon, 24 Aug 1998 06:09:53 -0700 (PDT) (envelope-from owner-freebsd-fs@FreeBSD.ORG) Received: from renko.ucs.ed.ac.uk (renko.ucs.ed.ac.uk [129.215.13.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA23049 for ; Mon, 24 Aug 1998 06:09:37 -0700 (PDT) (envelope-from sct@redhat.com) Received: from dax.dcs.ed.ac.uk (root@dialup-111.publab.ed.ac.uk [129.215.38.111]) by renko.ucs.ed.ac.uk (8.8.7/8.8.7) with ESMTP id OAA13296; Mon, 24 Aug 1998 14:07:50 +0100 (BST) Received: (from sct@localhost) by dax.dcs.ed.ac.uk (8.8.7/8.8.7) id KAA21958; Mon, 24 Aug 1998 10:34:16 +0100 Date: Mon, 24 Aug 1998 10:34:16 +0100 Message-Id: <199808240934.KAA21958@dax.dcs.ed.ac.uk> From: "Stephen C. Tweedie" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: poipoi@famipow.com Cc: freebsd-fs@FreeBSD.ORG, linux-fsdevel@vger.rutgers.edu Subject: Re: name cache wiping in readdir ? In-Reply-To: <19980823082102.396.qmail@hwi.poi.org> References: <19980823082102.396.qmail@hwi.poi.org> Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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