Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 16:40:18 -0800
From:      Peter Wemm <peter@wemm.org>
To:        Matt Dillon <dillon@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern vfs_subr.c 
Message-ID:  <20020201004018.857A63809@overcee.wemm.org>
In-Reply-To: <200201311851.g0VIpne43133@freefall.freebsd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020201004018.857A63809>