PERFORCE change 143684 for review

Nick Barkas snb at FreeBSD.org
Wed Jun 18 07:33:42 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=143684

Change 143684 by snb at 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


More information about the p4-projects mailing list