From owner-freebsd-hackers Thu Apr 12 10:31: 1 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 799C837B422 for ; Thu, 12 Apr 2001 10:30:58 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.2/8.11.2) id f3CHUf419830; Thu, 12 Apr 2001 10:30:41 -0700 (PDT) (envelope-from dillon) Date: Thu, 12 Apr 2001 10:30:41 -0700 (PDT) From: Matt Dillon Message-Id: <200104121730.f3CHUf419830@earth.backplane.com> To: Rik van Riel Cc: David Xu , freebsd-hackers@FreeBSD.ORG Subject: Re: vm balance References: Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : :On Tue, 10 Apr 2001, Matt Dillon wrote: : :> It's randomness that will kill performance. You know the old saying :> about caches: They only work if you get cache hits, otherwise :> they only slow things down. : :I wonder ... how does FreeBSD handle negative directory entries? : :That is, /bin/sh looks through the PATH to search for some executable :(eg grep) and doesn't find it in the first 3 directories. : :Does the vfs cache handle this or does FreeBSD have to go down into :the filesystem code every time? : :Rik The namei cache stores negative hits. /usr/src/sys/kern/vfs_cache.c cache_lookup() - if ncp->nc_vp (the vnode) is NULL, the cache entry represents a negative hit. cache_enter() - vp may be passed as NULL to create a negative cache entry. ufs/ufs/ufs_lookup.c, calls to cache_enter() enters positive or negative lookups as appropriate. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message