Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_pager.c
Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | |||||
uma_zone_t | uma_zone_t | ||||
pbuf_zsecond_create(const char *name, int max) | pbuf_zsecond_create(const char *name, int max) | ||||
{ | { | ||||
uma_zone_t zone; | uma_zone_t zone; | ||||
zone = uma_zsecond_create(name, pbuf_ctor, pbuf_dtor, NULL, NULL, | zone = uma_zsecond_create(name, pbuf_ctor, pbuf_dtor, NULL, NULL, | ||||
pbuf_zone); | pbuf_zone); | ||||
#ifdef KMSAN | |||||
/* | |||||
* Shrink the size of the pbuf pools if KMSAN is enabled, otherwise the | |||||
* shadows of the large KVA allocations eat up too much memory. | |||||
*/ | |||||
max /= 3; | |||||
#endif | |||||
/* | /* | ||||
* uma_prealloc() rounds up to items per slab. If we would prealloc | * uma_prealloc() rounds up to items per slab. If we would prealloc | ||||
* immediately on every pbuf_zsecond_create(), we may accumulate too | * immediately on every pbuf_zsecond_create(), we may accumulate too | ||||
* much of difference between hard limit and prealloced items, which | * much of difference between hard limit and prealloced items, which | ||||
* means wasted memory. | * means wasted memory. | ||||
*/ | */ | ||||
if (nswbuf_max > 0) | if (nswbuf_max > 0) | ||||
nswbuf_max += uma_zone_set_max(zone, max); | nswbuf_max += uma_zone_set_max(zone, max); | ||||
▲ Show 20 Lines • Show All 382 Lines • Show Last 20 Lines |