From 9799fcf93cf60f09104215fc4ecd696fcc117983 Mon Sep 17 00:00:00 2001 From: mohans Date: Wed, 24 Jan 2007 22:49:11 +0000 Subject: Fix for a bug where only one process (of multiple) blocked on maxpages on a zone is woken up, with the rest never being woken up as a result of the ZFLAG_FULL flag being cleared. Wakeup all such blocked procsses instead. This change introduces a thundering herd, but since this should be relatively infrequent, optimizing this (by introducing a count of blocked processes, for example) may be premature. Reviewd by: ups@ --- sys/vm/uma_core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sys/vm') diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 0bdcd2f..62e7aff 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -2475,8 +2475,13 @@ uma_zfree_internal(uma_zone_t zone, void *item, void *udata, if (keg->uk_pages < keg->uk_maxpages) keg->uk_flags &= ~UMA_ZFLAG_FULL; - /* We can handle one more allocation */ - wakeup_one(keg); + /* + * 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); -- cgit v1.1