Date: Wed, 06 Nov 2002 20:32:12 +0100 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Jeff Roberson <jroberson@chesapeake.net> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys malloc.h src/sys/kern kern_malloc.c Message-ID: <5999.1036611132@critter.freebsd.dk> In-Reply-To: Your message of "Wed, 06 Nov 2002 14:16:00 EST." <20021106141427.J1374-100000@mail.chesapeake.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20021106141427.J1374-100000@mail.chesapeake.net>, Jeff Roberson wri tes: >> 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(); > >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. I thought about it and then about the locking issues it might raise and then I thought "I'll let another mad-man try that" :-) Seriously, yes, I've actually wanted something like that for years, not only for the kernel but for userland as well. For the kernel, it will obviously have to be "best effort" and if the necessary locks are unavailable we have to punt. For userland I would like a "SIGVM" which says "spare a page". To be effective, this signal should _not_ result in a process to become runnable if it currently sleeps, rather, it should only be delivered when the process gets runnable for some other reason. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. 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?5999.1036611132>