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@
This commit is contained in:
Mohan Srinivasan 2007-01-24 22:49:11 +00:00
parent 1d8be4bade
commit 7738029183
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166211

View File

@ -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);