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

Function cache_alloc_retry

freebsd/vm/uma_core.c:3382–3405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3380}
3381
3382static __noinline void *
3383cache_alloc_retry(uma_zone_t zone, uma_cache_t cache, void *udata, int flags)
3384{
3385 uma_cache_bucket_t bucket;
3386 int domain;
3387
3388 while (cache_alloc(zone, cache, udata, flags)) {
3389 cache = &zone->uz_cpu[curcpu];
3390 bucket = &cache->uc_allocbucket;
3391 if (__predict_false(bucket->ucb_cnt == 0))
3392 continue;
3393 return (cache_alloc_item(zone, cache, bucket, udata, flags));
3394 }
3395 critical_exit();
3396
3397 /*
3398 * We can not get a bucket so try to return a single item.
3399 */
3400 if (zone->uz_flags & UMA_ZONE_FIRSTTOUCH)
3401 domain = PCPU_GET(domain);
3402 else
3403 domain = UMA_ANYDOMAIN;
3404 return (zone_alloc_item(zone, udata, domain, flags));
3405}
3406
3407/* See uma.h */
3408void *

Callers 2

uma_zalloc_smrFunction · 0.85
uma_zalloc_argFunction · 0.85

Calls 4

cache_alloc_itemFunction · 0.85
zone_alloc_itemFunction · 0.85
cache_allocFunction · 0.70
critical_exitFunction · 0.50

Tested by

no test coverage detected