Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Apr 1997 10:21:37 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        Poul-Henning Kamp <phk@dk.tfs.com>
Cc:        current@freebsd.org
Subject:   Re: vnode->v_usage 
Message-ID:  <Pine.BSF.3.95q.970428101839.346I-100000@herring.nlsystems.com>
In-Reply-To: <4914.862168293@critter>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970428101839.346I-100000>