Date: Sun, 27 Apr 1997 21:11:33 +0200 From: Poul-Henning Kamp <phk@dk.tfs.com> To: Doug Rabson <dfr@nlsystems.com> Cc: Poul-Henning Kamp <phk@dk.tfs.com>, current@freebsd.org Subject: Re: vnode->v_usage Message-ID: <4914.862168293@critter> In-Reply-To: Your message of "Sun, 27 Apr 1997 14:36:36 BST." <Pine.BSF.3.95q.970427143216.346G-100000@herring.nlsystems.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.3.95q.970427143216.346G-100000@herring.nlsystems.com>, Dou g Rabson writes: >On Sun, 27 Apr 1997, Poul-Henning Kamp wrote: > >> >> Unless somebody convinces me of the utility of this field, I will remove >> it from the vnodes. >> >> If you will be trying to convince me, please explain why it's clamped >> at 32 in vfs_cache.c. > >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 ? -- Poul-Henning Kamp | phk@FreeBSD.ORG FreeBSD Core-team. http://www.freebsd.org/~phk | phk@login.dknet.dk Private mailbox. whois: [PHK] | phk@tfs.com TRW Financial Systems, Inc. Power and ignorance is a disgusting cocktail.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4914.862168293>
