From owner-freebsd-current Sun Apr 27 12:12:48 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id MAA24067 for current-outgoing; Sun, 27 Apr 1997 12:12:48 -0700 (PDT) Received: from critter.dk.tfs.com (phk.cybercity.dk [195.8.129.17]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA24058; Sun, 27 Apr 1997 12:12:38 -0700 (PDT) Received: from critter (localhost [127.0.0.1]) by critter.dk.tfs.com (8.8.5/8.8.5) with ESMTP id VAA04916; Sun, 27 Apr 1997 21:11:34 +0200 (CEST) To: Doug Rabson cc: Poul-Henning Kamp , current@freebsd.org From: Poul-Henning Kamp Subject: Re: vnode->v_usage In-reply-to: Your message of "Sun, 27 Apr 1997 14:36:36 BST." Date: Sun, 27 Apr 1997 21:11:33 +0200 Message-ID: <4914.862168293@critter> Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In message , 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.