MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pbuf_zsecond_create

Function pbuf_zsecond_create

freebsd/vm/vm_pager.c:194–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194uma_zone_t
195pbuf_zsecond_create(const char *name, int max)
196{
197 uma_zone_t zone;
198
199 zone = uma_zsecond_create(name, pbuf_ctor, pbuf_dtor, NULL, NULL,
200 pbuf_zone);
201 /*
202 * uma_prealloc() rounds up to items per slab. If we would prealloc
203 * immediately on every pbuf_zsecond_create(), we may accumulate too
204 * much of difference between hard limit and prealloced items, which
205 * means wasted memory.
206 */
207 if (nswbuf_max > 0)
208 nswbuf_max += uma_zone_set_max(zone, max);
209 else
210 uma_prealloc(pbuf_zone, uma_zone_set_max(zone, max));
211
212 return (zone);
213}
214
215static void
216pbuf_prealloc(void *arg __unused)

Callers 3

cluster_initFunction · 0.85
swap_pager_swap_initFunction · 0.85
vnode_pager_initFunction · 0.85

Calls 3

uma_zsecond_createFunction · 0.85
uma_zone_set_maxFunction · 0.85
uma_preallocFunction · 0.85

Tested by

no test coverage detected