Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/uma_core.c
Context not available. | |||||
} | } | ||||
/* See uma.h */ | /* See uma.h */ | ||||
size_t | |||||
uma_zone_get_free_size(uma_zone_t zone) | |||||
{ | |||||
uma_klink_t kl; | |||||
uma_bucket_t bucket; | |||||
int64_t nitems; | |||||
u_int i; | |||||
ZONE_LOCK(zone); | |||||
nitems = 0; | |||||
if(!(zone->uz_flags & UMA_ZONE_SECONDARY)) { | |||||
LIST_FOREACH(kl, &zone->uz_kegs, kl_link) { | |||||
nitems += kl->kl_keg->uk_free; | |||||
} | |||||
} | |||||
CPU_FOREACH(i) { | |||||
/* | |||||
* See the comment in sysctl_vm_zone_stats() regarding the | |||||
* safety of accessing the per-cpu caches. With the zone lock | |||||
* held, it is safe, but can potentially result in stale data. | |||||
*/ | |||||
bucket = zone->uz_cpu[i].uc_allocbucket; | |||||
if (bucket != NULL) | |||||
nitems += bucket->ub_cnt; | |||||
bucket = zone->uz_cpu[i].uc_freebucket; | |||||
if (bucket != NULL) | |||||
nitems += bucket->ub_cnt; | |||||
} | |||||
ZONE_UNLOCK(zone); | |||||
return (nitems * zone->uz_size); | |||||
} | |||||
/* See uma.h */ | |||||
void | void | ||||
uma_zone_set_init(uma_zone_t zone, uma_init uminit) | uma_zone_set_init(uma_zone_t zone, uma_init uminit) | ||||
{ | { | ||||
Context not available. | |||||
} | } | ||||
/* See uma.h */ | /* See uma.h */ | ||||
void | |||||
uma_reclaim_zone_cache(uma_zone_t zone) | |||||
{ | |||||
bucket_enable(); | |||||
cache_drain_safe(zone); | |||||
} | |||||
/* See uma.h */ | |||||
static void | static void | ||||
uma_reclaim_locked(bool kmem_danger) | uma_reclaim_locked(bool kmem_danger) | ||||
{ | { | ||||
Context not available. |