From owner-freebsd-current Mon Apr 28 02:22:29 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA03486 for current-outgoing; Mon, 28 Apr 1997 02:22:29 -0700 (PDT) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA03480 for ; Mon, 28 Apr 1997 02:22:24 -0700 (PDT) Received: from herring.nlsystems.com (herring.nlsystems.com [10.0.0.2]) by nlsystems.com (8.8.5/8.8.5) with SMTP id KAA15389; Mon, 28 Apr 1997 10:21:37 +0100 (BST) Date: Mon, 28 Apr 1997 10:21:37 +0100 (BST) From: Doug Rabson To: Poul-Henning Kamp cc: current@freebsd.org Subject: Re: vnode->v_usage In-Reply-To: <4914.862168293@critter> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Sun, 27 Apr 1997, Poul-Henning Kamp wrote: > >I think it is intended to be used to keep frequently used vnodes from > >being recycled by getnewvnode. The idea is that whenever a vnode is found > >as a hit in the cache, its usage is increased. When getvnode picks a > >vnode off the front of the free list, it checks the usage and if >0 it > >decrements it, puts it at the back of the queue and goes onto the next > >one. This means that the lifetime of commonly used vnodes is extended. I > >don't know why it is clamped; possibly to put an upper bound on the > >lifetime of the vnode when it stops being used so frequently. > > Wouldn't it make more sense to use a LRU algorithm then ? > > As far as I recall we already add things to either end of the vnode > freelist, depending on the reusability of it, right ? > > So if vfs_cache.c simply pulled the vnode out of the free_list and > put it back at the tail, wouldn't that work ? Yes, I think that would work just as well and be less obscure as a result. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 951 1891