MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zone_free_limit

Function zone_free_limit

freebsd/vm/uma_core.c:3975–3996  ·  view source on GitHub ↗

* Free a number of items back to the limit. */

Source from the content-addressed store, hash-verified

3973 * Free a number of items back to the limit.
3974 */
3975static void
3976zone_free_limit(uma_zone_t zone, int count)
3977{
3978 uint64_t old;
3979
3980 MPASS(count > 0);
3981
3982 /*
3983 * In the common case we either have no sleepers or
3984 * are still over the limit and can just return.
3985 */
3986 old = atomic_fetchadd_64(&zone->uz_items, -count);
3987 if (__predict_true(UZ_ITEMS_SLEEPERS(old) == 0 ||
3988 UZ_ITEMS_COUNT(old) - count >= zone->uz_max_items))
3989 return;
3990
3991 /*
3992 * Moderate the rate of wakeups. Sleepers will continue
3993 * to generate wakeups if necessary.
3994 */
3995 wakeup_one(&zone->uz_max_items);
3996}
3997
3998static uma_bucket_t
3999zone_alloc_bucket(uma_zone_t zone, void *udata, int domain, int flags)

Callers 6

bucket_drainFunction · 0.85
zone_alloc_limit_hardFunction · 0.85
zone_alloc_limitFunction · 0.85
zone_alloc_bucketFunction · 0.85
zone_alloc_itemFunction · 0.85
zone_free_itemFunction · 0.85

Calls 2

atomic_fetchadd_64Function · 0.50
wakeup_oneFunction · 0.50

Tested by

no test coverage detected