Changeset View
Changeset View
Standalone View
Standalone View
head/sys/vm/uma_core.c
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static char *bootmem; | static char *bootmem; | ||||
static int boot_pages; | static int boot_pages; | ||||
static struct sx uma_drain_lock; | static struct sx uma_drain_lock; | ||||
/* kmem soft limit. */ | /* kmem soft limit. */ | ||||
static unsigned long uma_kmem_limit = LONG_MAX; | static unsigned long uma_kmem_limit = LONG_MAX; | ||||
static volatile unsigned long uma_kmem_total; | static unsigned long uma_kmem_total; | ||||
/* Is the VM done starting up? */ | /* Is the VM done starting up? */ | ||||
static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, | static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, | ||||
BOOT_RUNNING } booted = BOOT_COLD; | BOOT_RUNNING } booted = BOOT_COLD; | ||||
/* | /* | ||||
* This is the handle used to schedule events that need to happen | * This is the handle used to schedule events that need to happen | ||||
* outside of the allocation fast path. | * outside of the allocation fast path. | ||||
▲ Show 20 Lines • Show All 3,574 Lines • ▼ Show 20 Lines | uma_set_limit(unsigned long limit) | ||||
uma_kmem_limit = limit; | uma_kmem_limit = limit; | ||||
} | } | ||||
unsigned long | unsigned long | ||||
uma_size(void) | uma_size(void) | ||||
{ | { | ||||
return (uma_kmem_total); | return (atomic_load_long(&uma_kmem_total)); | ||||
} | } | ||||
long | long | ||||
uma_avail(void) | uma_avail(void) | ||||
{ | { | ||||
return (uma_kmem_limit - uma_kmem_total); | return (uma_kmem_limit - uma_size()); | ||||
} | } | ||||
void | void | ||||
uma_print_stats(void) | uma_print_stats(void) | ||||
{ | { | ||||
zone_foreach(uma_print_zone); | zone_foreach(uma_print_zone); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 472 Lines • Show Last 20 Lines |