Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/uma_core.c
Show First 20 Lines • Show All 2,357 Lines • ▼ Show 20 Lines | uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) | ||||
uma_cache_t cache; | uma_cache_t cache; | ||||
void *item; | void *item; | ||||
int cpu, domain, lockfail; | int cpu, domain, lockfail; | ||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
bool skipdbg; | bool skipdbg; | ||||
#endif | #endif | ||||
/* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | ||||
random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); | random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); | ||||
/* This is the fast path allocation */ | /* This is the fast path allocation */ | ||||
CTR4(KTR_UMA, "uma_zalloc_arg thread %x zone %s(%p) flags %d", | CTR4(KTR_UMA, "uma_zalloc_arg thread %x zone %s(%p) flags %d", | ||||
curthread, zone->uz_name, zone, flags); | curthread, zone->uz_name, zone, flags); | ||||
if (flags & M_WAITOK) { | if (flags & M_WAITOK) { | ||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, | WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, | ||||
"uma_zalloc_arg: zone \"%s\"", zone->uz_name); | "uma_zalloc_arg: zone \"%s\"", zone->uz_name); | ||||
▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | zalloc_item: | ||||
return (item); | return (item); | ||||
} | } | ||||
void * | void * | ||||
uma_zalloc_domain(uma_zone_t zone, void *udata, int domain, int flags) | uma_zalloc_domain(uma_zone_t zone, void *udata, int domain, int flags) | ||||
{ | { | ||||
/* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | ||||
random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); | random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); | ||||
/* This is the fast path allocation */ | /* This is the fast path allocation */ | ||||
CTR5(KTR_UMA, | CTR5(KTR_UMA, | ||||
"uma_zalloc_domain thread %x zone %s(%p) domain %d flags %d", | "uma_zalloc_domain thread %x zone %s(%p) domain %d flags %d", | ||||
curthread, zone->uz_name, zone, domain, flags); | curthread, zone->uz_name, zone, domain, flags); | ||||
if (flags & M_WAITOK) { | if (flags & M_WAITOK) { | ||||
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, | WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, | ||||
▲ Show 20 Lines • Show All 443 Lines • ▼ Show 20 Lines | uma_zfree_arg(uma_zone_t zone, void *item, void *udata) | ||||
uma_bucket_t bucket; | uma_bucket_t bucket; | ||||
uma_zone_domain_t zdom; | uma_zone_domain_t zdom; | ||||
int cpu, domain, lockfail; | int cpu, domain, lockfail; | ||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
bool skipdbg; | bool skipdbg; | ||||
#endif | #endif | ||||
/* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | ||||
random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); | random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); | ||||
CTR2(KTR_UMA, "uma_zfree_arg thread %x zone %s", curthread, | CTR2(KTR_UMA, "uma_zfree_arg thread %x zone %s", curthread, | ||||
zone->uz_name); | zone->uz_name); | ||||
KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), | KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), | ||||
("uma_zfree_arg: called with spinlock or critical section held")); | ("uma_zfree_arg: called with spinlock or critical section held")); | ||||
/* uma_zfree(..., NULL) does nothing, to match free(9). */ | /* uma_zfree(..., NULL) does nothing, to match free(9). */ | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | zfree_item: | ||||
return; | return; | ||||
} | } | ||||
void | void | ||||
uma_zfree_domain(uma_zone_t zone, void *item, void *udata) | uma_zfree_domain(uma_zone_t zone, void *item, void *udata) | ||||
{ | { | ||||
/* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ | ||||
random_harvest_fast_uma(&zone, sizeof(zone), 1, RANDOM_UMA); | random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); | ||||
CTR2(KTR_UMA, "uma_zfree_domain thread %x zone %s", curthread, | CTR2(KTR_UMA, "uma_zfree_domain thread %x zone %s", curthread, | ||||
zone->uz_name); | zone->uz_name); | ||||
KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), | KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), | ||||
("uma_zfree_domain: called with spinlock or critical section held")); | ("uma_zfree_domain: called with spinlock or critical section held")); | ||||
/* uma_zfree(..., NULL) does nothing, to match free(9). */ | /* uma_zfree(..., NULL) does nothing, to match free(9). */ | ||||
▲ Show 20 Lines • Show All 1,000 Lines • Show Last 20 Lines |