From owner-cvs-all Thu Jan 31 16:40:36 2002 Delivered-To: cvs-all@freebsd.org Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by hub.freebsd.org (Postfix) with ESMTP id 0313437B416; Thu, 31 Jan 2002 16:40:25 -0800 (PST) Received: from peter3.wemm.org ([12.232.27.13]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020201004024.OJHE26243.rwcrmhc51.attbi.com@peter3.wemm.org>; Fri, 1 Feb 2002 00:40:24 +0000 Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id g110eNs57360; Thu, 31 Jan 2002 16:40:23 -0800 (PST) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id 857A63809; Thu, 31 Jan 2002 16:40:18 -0800 (PST) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Matt Dillon Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_subr.c In-Reply-To: <200201311851.g0VIpne43133@freefall.freebsd.org> Date: Thu, 31 Jan 2002 16:40:18 -0800 From: Peter Wemm Message-Id: <20020201004018.857A63809@overcee.wemm.org> Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Matt Dillon wrote: > dillon 2002/01/31 10:51:48 PST > > Modified files: (Branch: RELENG_4) > sys/kern vfs_subr.c > Log: > MFC new vlrureclaim trigger-point code. vlrureclaim()'s purpose in life is > to maintain kern.maxvnodes, not to try to free memory. In fact, the reclai m > code is generally called when there is lots of memory available but the > system has too many vnodes. So we can safely skip vnodes which still have > a large number of resident pages present and thereby avoid unnecessary > flushes (e.g. for Yahoo, potentially nasty flushes of MAP_NOSYNC pages). > We calculate a resident count that guarentees we will still be able to > locate enough vnodes to reclaim to satisfy kern.maxvnodes. This is still insufficient FYI. On one hand, the reclaim should skip vnodes with *any* dirty pages and let syncer deal wit it. On the other hand, that policy could be exploited. But so can while(1) fork(); At Yahoo, we were forced to hack around this problem. We added a VNORECYCLE flag for *all* writeable MAP_SHARED file backed mmaps. We could probably have used something with VOBJDIRTY instead. I'm still uncomfortable with the fact that this is a clock-hand style vnode reclaim, rather than an LRU reclaim. ie: it keeps track of where it is up to as it walks gradually over the entire list rather than purging the oldest vnodes each time. In normal operation it will recycle much newer vnodes than the oldest we have laying around. Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message