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

Function bucket_init

freebsd/vm/uma_core.c:411–425  ·  view source on GitHub ↗

* Initialize bucket_zones, the array of zones of buckets of various sizes. * * For each zone, calculate the memory required for each bucket, consisting * of the header and an array of pointers. */

Source from the content-addressed store, hash-verified

409 * of the header and an array of pointers.
410 */
411static void
412bucket_init(void)
413{
414 struct uma_bucket_zone *ubz;
415 int size;
416
417 for (ubz = &bucket_zones[0]; ubz->ubz_entries != 0; ubz++) {
418 size = roundup(sizeof(struct uma_bucket), sizeof(void *));
419 size += sizeof(void *) * ubz->ubz_entries;
420 ubz->ubz_zone = uma_zcreate(ubz->ubz_name, size,
421 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR,
422 UMA_ZONE_MTXCLASS | UMA_ZFLAG_BUCKET |
423 UMA_ZONE_FIRSTTOUCH);
424 }
425}
426
427/*
428 * Given a desired number of entries for a bucket, return the zone from which

Callers 1

uma_startup1Function · 0.85

Calls 1

uma_zcreateFunction · 0.85

Tested by

no test coverage detected