Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/uma_core.c
Show First 20 Lines • Show All 2,854 Lines • ▼ Show 20 Lines | slab_alloc_item(uma_keg_t keg, uma_slab_t slab) | ||||
return (item); | return (item); | ||||
} | } | ||||
static int | static int | ||||
zone_import(uma_zone_t zone, void **bucket, int max, int domain, int flags) | zone_import(uma_zone_t zone, void **bucket, int max, int domain, int flags) | ||||
{ | { | ||||
uma_slab_t slab; | uma_slab_t slab; | ||||
uma_keg_t keg; | uma_keg_t keg; | ||||
#ifdef NUMA | |||||
int stripe; | int stripe; | ||||
#endif | |||||
int i; | int i; | ||||
slab = NULL; | slab = NULL; | ||||
keg = NULL; | keg = NULL; | ||||
/* Try to keep the buckets totally full */ | /* Try to keep the buckets totally full */ | ||||
for (i = 0; i < max; ) { | for (i = 0; i < max; ) { | ||||
if ((slab = zone->uz_slab(zone, keg, domain, flags)) == NULL) | if ((slab = zone->uz_slab(zone, keg, domain, flags)) == NULL) | ||||
break; | break; | ||||
keg = slab->us_keg; | keg = slab->us_keg; | ||||
#ifdef NUMA | |||||
stripe = howmany(max, vm_ndomains); | stripe = howmany(max, vm_ndomains); | ||||
#endif | |||||
while (slab->us_freecount && i < max) { | while (slab->us_freecount && i < max) { | ||||
bucket[i++] = slab_alloc_item(keg, slab); | bucket[i++] = slab_alloc_item(keg, slab); | ||||
if (keg->uk_free <= keg->uk_reserve) | if (keg->uk_free <= keg->uk_reserve) | ||||
break; | break; | ||||
#ifdef NUMA | #ifdef NUMA | ||||
/* | /* | ||||
* If the zone is striped we pick a new slab for every | * If the zone is striped we pick a new slab for every | ||||
* N allocations. Eliminating this conditional will | * N allocations. Eliminating this conditional will | ||||
▲ Show 20 Lines • Show All 1,369 Lines • Show Last 20 Lines |