[PATCH] wakeup keg if zone_max is altered

From: LI Xin <delphij_at_delphij.net>
Date: Wed, 12 Sep 2007 10:54:58 +0800
Hi,

Here is a patch that wakes up keg if zone_max is altered when necessay.
 Objections?

Cheers,
-- 
Xin LI <delphij_at_delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!

Index: uma_core.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/uma_core.c,v
retrieving revision 1.147
diff -u -p -r1.147 uma_core.c
--- uma_core.c	31 May 2007 22:52:14 -0000	1.147
+++ uma_core.c	12 Sep 2007 02:53:43 -0000
_at__at_ -2514,6 +2514,18 _at__at_ uma_zone_set_max(uma_zone_t zone, int ni
 	if (keg->uk_maxpages * keg->uk_ipers < nitems)
 		keg->uk_maxpages++;
 
+	if (keg->uk_flags & UMA_ZFLAG_FULL) {
+		if (keg->uk_pages < keg->uk_maxpages)
+			keg->uk_flags &= ~UMA_ZFLAG_FULL;
+
+		/* 
+		 * We can handle one more allocation. Since we're clearing ZFLAG_FULL,
+		 * wake up all procs blocked on pages. This should be uncommon, so 
+		 * keeping this simple for now (rather than adding count of blocked 
+		 * threads etc).
+		 */
+		wakeup(keg);
+	}
 	ZONE_UNLOCK(zone);
 }
 

Received on Wed Sep 12 2007 - 00:55:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:17 UTC