From owner-cvs-all Wed Nov 6 11:16: 3 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD06137B401; Wed, 6 Nov 2002 11:16:01 -0800 (PST) Received: from mail.chesapeake.net (chesapeake.net [205.130.220.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CEEF43E42; Wed, 6 Nov 2002 11:16:01 -0800 (PST) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost) by mail.chesapeake.net (8.11.6/8.11.6) with ESMTP id gA6JG0k09344; Wed, 6 Nov 2002 14:16:00 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Wed, 6 Nov 2002 14:16:00 -0500 (EST) From: Jeff Roberson To: Poul-Henning Kamp Cc: cvs-committers@FreeBSD.org, Subject: Re: cvs commit: src/sys/sys malloc.h src/sys/kern kern_malloc.c In-Reply-To: <200211011858.gA1IwDrc035364@repoman.freebsd.org> Message-ID: <20021106141427.J1374-100000@mail.chesapeake.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Fri, 1 Nov 2002, Poul-Henning Kamp wrote: > phk 2002/11/01 10:58:13 PST > > Modified files: > sys/sys malloc.h > sys/kern kern_malloc.c > Log: > Introduce malloc_last_fail() which returns the number of seconds since > malloc(9) failed last time. This is intended to help code adjust > memory usage to the current circumstances. > > A typical use could be: > if (malloc_last_fail() < 60) > reduce_cache_by_one(); > > Revision Changes Path > 1.113 +16 -0 src/sys/kern/kern_malloc.c > 1.68 +1 -0 src/sys/sys/malloc.h > I would like to add a 'flush' callback to uma. So each zone could get a callback when the system is low on memory and it could reduce it's memory footprint. This would be very effective for something like the vnode cache or the directory cache, etc. What do you think of this? It would be trivial to add. Cheers, Jeff To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message