Date: Wed, 18 Jun 2008 07:33:41 GMT From: Nick Barkas <snb@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 143684 for review Message-ID: <200806180733.m5I7XfSZ096464@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143684 Change 143684 by snb@snb_toro on 2008/06/18 07:33:00 Definition of a new function to free dirhashes when the kernel signals that memory is low. Affected files ... .. //depot/projects/soc2008/snb-dirhash/sys-ufs-ufs/ufs_dirhash.c#2 edit Differences ... ==== //depot/projects/soc2008/snb-dirhash/sys-ufs-ufs/ufs_dirhash.c#2 (text+ko) ==== @@ -48,6 +48,7 @@ #include <sys/vnode.h> #include <sys/mount.h> #include <sys/sysctl.h> +#include <sys/eventhandler.h> #include <vm/uma.h> #include <ufs/ufs/quota.h> @@ -1132,6 +1133,15 @@ return (0); } +/* + * Calback that frees some dirhashes when the system is low on virtual memory. + */ +static void +ufsdirhash_lowmem() +{ + +} + void ufsdirhash_init() @@ -1140,6 +1150,10 @@ NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); mtx_init(&ufsdirhash_mtx, "dirhash list", NULL, MTX_DEF); TAILQ_INIT(&ufsdirhash_list); + + /* Register a callback function to handle low memory signals */ + EVENTHANDLER_REGISTER(vm_lowmem, ufsdirhash_lowmem, NULL, + EVENTHANDLER_PRI_FIRST); } void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806180733.m5I7XfSZ096464>