summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authormohans <mohans@FreeBSD.org>2007-01-24 22:49:11 +0000
committermohans <mohans@FreeBSD.org>2007-01-24 22:49:11 +0000
commit9799fcf93cf60f09104215fc4ecd696fcc117983 (patch)
treed19549412a149515186684b2dafff0273199155a /sys/vm
parent802f16fd6b78275308788fca215ccfc5ebab4175 (diff)
downloadFreeBSD-src-9799fcf93cf60f09104215fc4ecd696fcc117983.zip
FreeBSD-src-9799fcf93cf60f09104215fc4ecd696fcc117983.tar.gz
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@
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/uma_core.c9
1 files changed, 7 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud