FreeBSD virtual memory subsystem code
uma_core.c File Reference
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_param.h"
#include "opt_vm.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/asan.h>
#include <sys/bitset.h>
#include <sys/domainset.h>
#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/types.h>
#include <sys/limits.h>
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/ktr.h>
#include <sys/lock.h>
#include <sys/msan.h>
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/random.h>
#include <sys/rwlock.h>
#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/sleepqueue.h>
#include <sys/smp.h>
#include <sys/smr.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/vmmeter.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_domainset.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
#include <vm/vm_phys.h>
#include <vm/vm_pagequeue.h>
#include <vm/vm_map.h>
#include <vm/vm_kern.h>
#include <vm/vm_extern.h>
#include <vm/vm_dumpset.h>
#include <vm/uma.h>
#include <vm/uma_int.h>
#include <vm/uma_dbg.h>
#include <ddb/ddb.h>
#include <machine/md_var.h>
Include dependency graph for uma_core.c:

Go to the source code of this file.

Data Structures

struct  uma_zctor_args
 
struct  uma_kctor_args
 
struct  uma_bucket_zone
 
struct  keg_layout_result
 
struct  uma_zone_count
 
struct  uma_reclaim_args
 

Macros

#define UMA_ALWAYS_CTORDTOR   0
 
#define SLAB_BITSETS   1
 
#define SLABZONE_SIZE(setsize)    (sizeof(struct uma_hash_slab) + BITSET_SIZE(setsize) * SLAB_BITSETS)
 
#define SLABZONE0_SETSIZE   (PAGE_SIZE / 16)
 
#define SLABZONE1_SETSIZE   SLAB_MAX_SETSIZE
 
#define SLABZONE0_SIZE   SLABZONE_SIZE(SLABZONE0_SETSIZE)
 
#define SLABZONE1_SIZE   SLABZONE_SIZE(SLABZONE1_SETSIZE)
 
#define UMA_TIMEOUT   20 /* Seconds for callout interval. */
 
#define BUCKET_SIZE(n)    (((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *))
 
#define BUCKET_MAX   BUCKET_SIZE(256)
 
#define UMA_FIXPT_SHIFT   31
 
#define UMA_FRAC_FIXPT(n, d)    ((uint32_t)(((uint64_t)(n) << UMA_FIXPT_SHIFT) / (d)))
 
#define UMA_FIXPT_PCT(f)    ((u_int)(((uint64_t)100 * (f)) >> UMA_FIXPT_SHIFT))
 
#define UMA_PCT_FIXPT(pct)   UMA_FRAC_FIXPT((pct), 100)
 
#define UMA_MIN_EFF   UMA_PCT_FIXPT(100 - UMA_MAX_WASTE)
 

Enumerations

enum  zfreeskip { SKIP_NONE = 0 , SKIP_CNT = 0x00000001 , SKIP_DTOR = 0x00010000 , SKIP_FINI = 0x00020000 }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static MALLOC_DEFINE (M_UMAHASH, "UMAHash", "UMA Hash Buckets")
 
static MALLOC_DEFINE (M_UMA, "UMA", "UMA Misc")
 
static LIST_HEAD (uma_keg)
 
void uma_startup1 (vm_offset_t)
 
void uma_startup2 (void)
 
static void * noobj_alloc (uma_zone_t, vm_size_t, int, uint8_t *, int)
 
static void * page_alloc (uma_zone_t, vm_size_t, int, uint8_t *, int)
 
static void * pcpu_page_alloc (uma_zone_t, vm_size_t, int, uint8_t *, int)
 
static void * startup_alloc (uma_zone_t, vm_size_t, int, uint8_t *, int)
 
static void * contig_alloc (uma_zone_t, vm_size_t, int, uint8_t *, int)
 
static void page_free (void *, vm_size_t, uint8_t)
 
static void pcpu_page_free (void *, vm_size_t, uint8_t)
 
static uma_slab_t keg_alloc_slab (uma_keg_t, uma_zone_t, int, int, int)
 
static void cache_drain (uma_zone_t)
 
static void bucket_drain (uma_zone_t, uma_bucket_t)
 
static void bucket_cache_reclaim (uma_zone_t zone, bool, int)
 
static bool bucket_cache_reclaim_domain (uma_zone_t, bool, bool, int)
 
static int keg_ctor (void *, int, void *, int)
 
static void keg_dtor (void *, int, void *)
 
static void keg_drain (uma_keg_t keg, int domain)
 
static int zone_ctor (void *, int, void *, int)
 
static void zone_dtor (void *, int, void *)
 
static void item_dtor (uma_zone_t zone, void *item, int size, void *udata, enum zfreeskip skip)
 
static int zero_init (void *, int, int)
 
static void zone_free_bucket (uma_zone_t zone, uma_bucket_t bucket, void *udata, int itemdomain, bool ws)
 
static void zone_foreach (void(*zfunc)(uma_zone_t, void *), void *)
 
static void zone_foreach_unlocked (void(*zfunc)(uma_zone_t, void *), void *)
 
static void zone_timeout (uma_zone_t zone, void *)
 
static int hash_alloc (struct uma_hash *, u_int)
 
static int hash_expand (struct uma_hash *, struct uma_hash *)
 
static void hash_free (struct uma_hash *hash)
 
static void uma_timeout (void *)
 
static void uma_shutdown (void)
 
static void * zone_alloc_item (uma_zone_t, void *, int, int)
 
static void zone_free_item (uma_zone_t, void *, void *, enum zfreeskip)
 
static int zone_alloc_limit (uma_zone_t zone, int count, int flags)
 
static void zone_free_limit (uma_zone_t zone, int count)
 
static void bucket_enable (void)
 
static void bucket_init (void)
 
static uma_bucket_t bucket_alloc (uma_zone_t zone, void *, int)
 
static void bucket_free (uma_zone_t zone, uma_bucket_t, void *)
 
static void bucket_zone_drain (int domain)
 
static uma_bucket_t zone_alloc_bucket (uma_zone_t, void *, int, int)
 
static void * slab_alloc_item (uma_keg_t keg, uma_slab_t slab)
 
static void slab_free_item (uma_zone_t zone, uma_slab_t slab, void *item)
 
static size_t slab_sizeof (int nitems)
 
static uma_keg_t uma_kcreate (uma_zone_t zone, size_t size, uma_init uminit, uma_fini fini, int align, uint32_t flags)
 
static int zone_import (void *, void **, int, int, int)
 
static void zone_release (void *, void **, int)
 
static bool cache_alloc (uma_zone_t, uma_cache_t, void *, int)
 
static bool cache_free (uma_zone_t, uma_cache_t, void *, int)
 
static int sysctl_vm_zone_count (SYSCTL_HANDLER_ARGS)
 
static int sysctl_vm_zone_stats (SYSCTL_HANDLER_ARGS)
 
static int sysctl_handle_uma_zone_allocs (SYSCTL_HANDLER_ARGS)
 
static int sysctl_handle_uma_zone_frees (SYSCTL_HANDLER_ARGS)
 
static int sysctl_handle_uma_zone_flags (SYSCTL_HANDLER_ARGS)
 
static int sysctl_handle_uma_slab_efficiency (SYSCTL_HANDLER_ARGS)
 
static int sysctl_handle_uma_zone_items (SYSCTL_HANDLER_ARGS)
 
static uint64_t uma_zone_get_allocs (uma_zone_t zone)
 
static SYSCTL_NODE (_vm, OID_AUTO, debug, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "Memory allocation debugging")
 
 SYSCTL_NODE (_vm, OID_AUTO, uma, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Universal Memory Allocator")
 
 SYSCTL_PROC (_vm, OID_AUTO, zone_count, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLTYPE_INT, 0, 0, sysctl_vm_zone_count, "I", "Number of UMA zones")
 
 SYSCTL_PROC (_vm, OID_AUTO, zone_stats, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLTYPE_STRUCT, 0, 0, sysctl_vm_zone_stats, "s,struct uma_type_header", "Zone Stats")
 
 SYSCTL_INT (_vm, OID_AUTO, zone_warnings, CTLFLAG_RWTUN, &zone_warnings, 0, "Warn when UMA zones becomes full")
 
 TUNABLE_INT ("vm.debug.uma_multipage_slabs", &multipage_slabs)
 
 SYSCTL_INT (_vm_debug, OID_AUTO, uma_multipage_slabs, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &multipage_slabs, 0, "UMA may choose larger slab sizes for better efficiency")
 
static uma_zone_t slabzone (int ipers)
 
static struct uma_bucket_zonebucket_zone_lookup (int entries)
 
static int bucket_select (int size)
 
static void kasan_mark_item_valid (uma_zone_t zone __unused, void *item __unused)
 
static void kasan_mark_item_invalid (uma_zone_t zone __unused, void *item __unused)
 
static void kasan_mark_slab_valid (uma_keg_t keg __unused, void *mem __unused)
 
static void kasan_mark_slab_invalid (uma_keg_t keg __unused, void *mem __unused)
 
static void kmsan_mark_item_uninitialized (uma_zone_t zone __unused, void *item __unused)
 
static uma_zone_domain_t zone_domain_lock (uma_zone_t zone, int domain)
 
static __noinline int zone_domain_lowest (uma_zone_t zone, int pref)
 
static __noinline int zone_domain_highest (uma_zone_t zone, int pref)
 
static void zone_domain_imax_set (uma_zone_domain_t zdom, int nitems)
 
static uma_bucket_t zone_fetch_bucket (uma_zone_t zone, uma_zone_domain_t zdom, bool reclaim)
 
static void zone_put_bucket (uma_zone_t zone, int domain, uma_bucket_t bucket, void *udata, const bool ws)
 
static void * cache_bucket_pop (uma_cache_t cache, uma_cache_bucket_t bucket)
 
static void cache_bucket_push (uma_cache_t cache, uma_cache_bucket_t bucket, void *item)
 
static uma_bucket_t cache_bucket_unload (uma_cache_bucket_t bucket)
 
static uma_bucket_t cache_bucket_unload_alloc (uma_cache_t cache)
 
static uma_bucket_t cache_bucket_unload_free (uma_cache_t cache)
 
static uma_bucket_t cache_bucket_unload_cross (uma_cache_t cache)
 
static void cache_bucket_load (uma_cache_bucket_t bucket, uma_bucket_t b)
 
static void cache_bucket_load_alloc (uma_cache_t cache, uma_bucket_t b)
 
static void cache_bucket_load_free (uma_cache_t cache, uma_bucket_t b)
 
static void cache_bucket_copy (uma_cache_bucket_t b1, uma_cache_bucket_t b2)
 
static void cache_bucket_swap (uma_cache_bucket_t b1, uma_cache_bucket_t b2)
 
static uma_bucket_t cache_fetch_bucket (uma_zone_t zone, uma_cache_t cache, int domain)
 
static void zone_log_warning (uma_zone_t zone)
 
static void zone_maxaction (uma_zone_t zone)
 
static void zone_domain_update_wss (uma_zone_domain_t zdom)
 
static void cache_shrink (uma_zone_t zone, void *unused)
 
static void cache_drain_safe_cpu (uma_zone_t zone, void *unused)
 
static void pcpu_cache_drain_safe (uma_zone_t zone)
 
static void keg_free_slab (uma_keg_t keg, uma_slab_t slab, int start)
 
static void keg_drain_domain (uma_keg_t keg, int domain)
 
static void zone_reclaim (uma_zone_t zone, int domain, int waitok, bool drain)
 
static void startup_free (void *mem, vm_size_t bytes)
 
static u_int slab_ipers_hdr (u_int size, u_int rsize, u_int slabsize, bool hdr)
 
static void keg_layout_one (uma_keg_t keg, u_int rsize, u_int slabsize, u_int fmt, struct keg_layout_result *kl)
 
static void keg_layout (uma_keg_t keg)
 
static void zone_kva_available (uma_zone_t zone, void *unused)
 
static void zone_alloc_counters (uma_zone_t zone, void *unused)
 
static void zone_alloc_sysctl (uma_zone_t zone, void *unused)
 
static void zone_count (uma_zone_t zone, void *arg)
 
static void zone_update_caches (uma_zone_t zone)
 
static void zone_foreach_unlocked (void(*zfunc)(uma_zone_t, void *arg), void *arg)
 
static void zone_foreach (void(*zfunc)(uma_zone_t, void *arg), void *arg)
 
void vm_radix_reserve_kva (void)
 
static void uma_startup_pcpu (void *arg __unused)
 
 SYSINIT (uma_startup_pcpu, SI_SUB_COUNTER, SI_ORDER_ANY, uma_startup_pcpu, NULL)
 
static void uma_startup3 (void *arg __unused)
 
 SYSINIT (uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL)
 
void uma_set_align (int align)
 
uma_zone_t uma_zcreate (const char *name, size_t size, uma_ctor ctor, uma_dtor dtor, uma_init uminit, uma_fini fini, int align, uint32_t flags)
 
uma_zone_t uma_zsecond_create (const char *name, uma_ctor ctor, uma_dtor dtor, uma_init zinit, uma_fini zfini, uma_zone_t primary)
 
uma_zone_t uma_zcache_create (const char *name, int size, uma_ctor ctor, uma_dtor dtor, uma_init zinit, uma_fini zfini, uma_import zimport, uma_release zrelease, void *arg, int flags)
 
void uma_zdestroy (uma_zone_t zone)
 
void uma_zwait (uma_zone_t zone)
 
void * uma_zalloc_pcpu_arg (uma_zone_t zone, void *udata, int flags)
 
void uma_zfree_pcpu_arg (uma_zone_t zone, void *pcpu_item, void *udata)
 
static void * item_ctor (uma_zone_t zone, int uz_flags, int size, void *udata, int flags, void *item)
 
static void * cache_alloc_item (uma_zone_t zone, uma_cache_t cache, uma_cache_bucket_t bucket, void *udata, int flags)
 
static __noinline void * cache_alloc_retry (uma_zone_t zone, uma_cache_t cache, void *udata, int flags)
 
void * uma_zalloc_smr (uma_zone_t zone, int flags)
 
void * uma_zalloc_arg (uma_zone_t zone, void *udata, int flags)
 
void * uma_zalloc_domain (uma_zone_t zone, void *udata, int domain, int flags)
 
static uma_slab_t keg_first_slab (uma_keg_t keg, int domain, bool rr)
 
static uma_slab_t keg_fetch_free_slab (uma_keg_t keg, int domain, bool rr, int flags)
 
static uma_slab_t keg_fetch_slab (uma_keg_t keg, uma_zone_t zone, int rdomain, const int flags)
 
static int zone_alloc_limit_hard (uma_zone_t zone, int count, int flags)
 
void uma_zfree_smr (uma_zone_t zone, void *item)
 
void uma_zfree_arg (uma_zone_t zone, void *item, void *udata)
 
int uma_zone_set_max (uma_zone_t zone, int nitems)
 
void uma_zone_set_maxcache (uma_zone_t zone, int nitems)
 
int uma_zone_get_max (uma_zone_t zone)
 
void uma_zone_set_warning (uma_zone_t zone, const char *warning)
 
void uma_zone_set_maxaction (uma_zone_t zone, uma_maxaction_t maxaction)
 
int uma_zone_get_cur (uma_zone_t zone)
 
static uint64_t uma_zone_get_frees (uma_zone_t zone)
 
void uma_zone_set_init (uma_zone_t zone, uma_init uminit)
 
void uma_zone_set_fini (uma_zone_t zone, uma_fini fini)
 
void uma_zone_set_zinit (uma_zone_t zone, uma_init zinit)
 
void uma_zone_set_zfini (uma_zone_t zone, uma_fini zfini)
 
void uma_zone_set_freef (uma_zone_t zone, uma_free freef)
 
void uma_zone_set_allocf (uma_zone_t zone, uma_alloc allocf)
 
void uma_zone_set_smr (uma_zone_t zone, smr_t smr)
 
smr_t uma_zone_get_smr (uma_zone_t zone)
 
void uma_zone_reserve (uma_zone_t zone, int items)
 
int uma_zone_reserve_kva (uma_zone_t zone, int count)
 
void uma_prealloc (uma_zone_t zone, int items)
 
size_t uma_zone_memory (uma_zone_t zone)
 
static void uma_reclaim_domain_cb (uma_zone_t zone, void *arg)
 
void uma_reclaim (int req)
 
void uma_reclaim_domain (int req, int domain)
 
void uma_reclaim_wakeup (void)
 
void uma_reclaim_worker (void *arg __unused)
 
void uma_zone_reclaim (uma_zone_t zone, int req)
 
void uma_zone_reclaim_domain (uma_zone_t zone, int req, int domain)
 
int uma_zone_exhausted (uma_zone_t zone)
 
unsigned long uma_limit (void)
 
void uma_set_limit (unsigned long limit)
 
unsigned long uma_size (void)
 
long uma_avail (void)
 
static void uma_vm_zone_stats (struct uma_type_header *uth, uma_zone_t z, struct sbuf *sbuf, struct uma_percpu_stat *ups, bool internal)
 
int sysctl_handle_uma_zone_max (SYSCTL_HANDLER_ARGS)
 
int sysctl_handle_uma_zone_cur (SYSCTL_HANDLER_ARGS)
 

Variables

static uma_zone_t kegs
 
static uma_zone_t zones
 
static uma_zone_t slabzones [2]
 
static uma_zone_t hashzone
 
int uma_align_cache = 64 - 1
 
static int bucketdisable = 1
 
 booted = BOOT_COLD
 
static struct callout uma_callout
 
struct uma_bucket_zone bucket_zones []
 
static int zone_warnings = 1
 
static int multipage_slabs = 1
 
static volatile int uma_reclaim_needed
 

Macro Definition Documentation

◆ BUCKET_MAX

#define BUCKET_MAX   BUCKET_SIZE(256)

Definition at line 255 of file uma_core.c.

◆ BUCKET_SIZE

#define BUCKET_SIZE (   n)     (((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *))

Definition at line 252 of file uma_core.c.

◆ SLAB_BITSETS

#define SLAB_BITSETS   1

Definition at line 129 of file uma_core.c.

◆ SLABZONE0_SETSIZE

#define SLABZONE0_SETSIZE   (PAGE_SIZE / 16)

Definition at line 142 of file uma_core.c.

◆ SLABZONE0_SIZE

#define SLABZONE0_SIZE   SLABZONE_SIZE(SLABZONE0_SETSIZE)

Definition at line 144 of file uma_core.c.

◆ SLABZONE1_SETSIZE

#define SLABZONE1_SETSIZE   SLAB_MAX_SETSIZE

Definition at line 143 of file uma_core.c.

◆ SLABZONE1_SIZE

#define SLABZONE1_SIZE   SLABZONE_SIZE(SLABZONE1_SETSIZE)

Definition at line 145 of file uma_core.c.

◆ SLABZONE_SIZE

#define SLABZONE_SIZE (   setsize)     (sizeof(struct uma_hash_slab) + BITSET_SIZE(setsize) * SLAB_BITSETS)

Definition at line 140 of file uma_core.c.

◆ UMA_ALWAYS_CTORDTOR

#define UMA_ALWAYS_CTORDTOR   0

Definition at line 113 of file uma_core.c.

◆ UMA_FIXPT_PCT

#define UMA_FIXPT_PCT (   f)     ((u_int)(((uint64_t)100 * (f)) >> UMA_FIXPT_SHIFT))

Definition at line 2175 of file uma_core.c.

◆ UMA_FIXPT_SHIFT

#define UMA_FIXPT_SHIFT   31

Definition at line 2172 of file uma_core.c.

◆ UMA_FRAC_FIXPT

#define UMA_FRAC_FIXPT (   n,
 
)     ((uint32_t)(((uint64_t)(n) << UMA_FIXPT_SHIFT) / (d)))

Definition at line 2173 of file uma_core.c.

◆ UMA_MIN_EFF

#define UMA_MIN_EFF   UMA_PCT_FIXPT(100 - UMA_MAX_WASTE)

Definition at line 2178 of file uma_core.c.

◆ UMA_PCT_FIXPT

#define UMA_PCT_FIXPT (   pct)    UMA_FRAC_FIXPT((pct), 100)

Definition at line 2177 of file uma_core.c.

◆ UMA_TIMEOUT

#define UMA_TIMEOUT   20 /* Seconds for callout interval. */

Definition at line 211 of file uma_core.c.

Enumeration Type Documentation

◆ zfreeskip

enum zfreeskip
Enumerator
SKIP_NONE 
SKIP_CNT 
SKIP_DTOR 
SKIP_FINI 

Definition at line 274 of file uma_core.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ bucket_alloc()

static uma_bucket_t bucket_alloc ( uma_zone_t  zone,
void *  udata,
int  flags 
)
static

◆ bucket_cache_reclaim()

static void bucket_cache_reclaim ( uma_zone_t  zone,
bool  drain,
int  domain 
)
static

Definition at line 1573 of file uma_core.c.

References bucket_cache_reclaim_domain(), UMA_ANYDOMAIN, UMA_ZONE_ROUNDROBIN, uma_zone::uz_bucket_size, uma_zone::uz_bucket_size_min, uma_zone::uz_flags, and vm_ndomains.

Referenced by cache_drain(), and zone_reclaim().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bucket_cache_reclaim_domain()

static bool bucket_cache_reclaim_domain ( uma_zone_t  zone,
bool  drain,
bool  trim,
int  domain 
)
static

◆ bucket_drain()

static void bucket_drain ( uma_zone_t  zone,
uma_bucket_t  bucket 
)
static

◆ bucket_enable()

static void bucket_enable ( void  )
static

Definition at line 404 of file uma_core.c.

References booted, and bucketdisable.

Referenced by uma_reclaim_domain(), uma_startup2(), and uma_timeout().

Here is the caller graph for this function:

◆ bucket_free()

static void bucket_free ( uma_zone_t  zone,
uma_bucket_t  bucket,
void *  udata 
)
static

◆ bucket_init()

static void bucket_init ( void  )
static

Definition at line 418 of file uma_core.c.

References bucket_zones, uma_bucket_zone::ubz_entries, uma_bucket_zone::ubz_name, uma_bucket_zone::ubz_zone, UMA_ALIGN_PTR, uma_zcreate(), UMA_ZFLAG_BUCKET, UMA_ZONE_FIRSTTOUCH, and UMA_ZONE_MTXCLASS.

Referenced by uma_startup1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bucket_select()

static int bucket_select ( int  size)
static

Definition at line 450 of file uma_core.c.

References bucket_zones, uma_bucket_zone::ubz_entries, and uma_bucket_zone::ubz_maxsize.

Referenced by zone_ctor().

Here is the caller graph for this function:

◆ bucket_zone_drain()

static void bucket_zone_drain ( int  domain)
static

Definition at line 534 of file uma_core.c.

References bucket_zones, uma_bucket_zone::ubz_entries, uma_bucket_zone::ubz_zone, UMA_RECLAIM_DRAIN, and uma_zone_reclaim_domain().

Referenced by uma_reclaim_domain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bucket_zone_lookup()

static struct uma_bucket_zone * bucket_zone_lookup ( int  entries)
static

Definition at line 438 of file uma_core.c.

References bucket_zones, and uma_bucket_zone::ubz_entries.

Referenced by bucket_alloc(), and bucket_free().

Here is the caller graph for this function:

◆ cache_alloc()

◆ cache_alloc_item()

static void * cache_alloc_item ( uma_zone_t  zone,
uma_cache_t  cache,
uma_cache_bucket_t  bucket,
void *  udata,
int  flags 
)
inlinestatic

Definition at line 3570 of file uma_core.c.

References cache_bucket_pop(), cache_uz_flags(), cache_uz_size(), uma_zctor_args::flags, item_ctor(), and uma_zctor_args::size.

Referenced by cache_alloc_retry(), uma_zalloc_arg(), and uma_zalloc_smr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_alloc_retry()

static __noinline void * cache_alloc_retry ( uma_zone_t  zone,
uma_cache_t  cache,
void *  udata,
int  flags 
)
static

Definition at line 3584 of file uma_core.c.

References cache_alloc(), cache_alloc_item(), uma_zctor_args::flags, uma_cache::uc_allocbucket, uma_cache_bucket::ucb_cnt, UMA_ANYDOMAIN, UMA_ZONE_FIRSTTOUCH, uma_zone::uz_cpu, uma_zone::uz_flags, and zone_alloc_item().

Referenced by uma_zalloc_arg(), and uma_zalloc_smr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_bucket_copy()

static void cache_bucket_copy ( uma_cache_bucket_t  b1,
uma_cache_bucket_t  b2 
)
inlinestatic

Definition at line 1023 of file uma_core.c.

References uma_cache_bucket::ucb_bucket, uma_cache_bucket::ucb_cnt, and uma_cache_bucket::ucb_entries.

Referenced by cache_bucket_swap().

Here is the caller graph for this function:

◆ cache_bucket_load()

static void cache_bucket_load ( uma_cache_bucket_t  bucket,
uma_bucket_t  b 
)
inlinestatic

◆ cache_bucket_load_alloc()

static void cache_bucket_load_alloc ( uma_cache_t  cache,
uma_bucket_t  b 
)
inlinestatic

Definition at line 997 of file uma_core.c.

References cache_bucket_load(), and uma_cache::uc_allocbucket.

Referenced by cache_alloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_bucket_load_free()

static void cache_bucket_load_free ( uma_cache_t  cache,
uma_bucket_t  b 
)
inlinestatic

Definition at line 1004 of file uma_core.c.

References cache_bucket_load(), and uma_cache::uc_freebucket.

Referenced by cache_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_bucket_pop()

static void * cache_bucket_pop ( uma_cache_t  cache,
uma_cache_bucket_t  bucket 
)
inlinestatic

Definition at line 909 of file uma_core.c.

References uma_bucket::ub_bucket, uma_cache::uc_allocs, uma_cache_bucket::ucb_bucket, and uma_cache_bucket::ucb_cnt.

Referenced by cache_alloc_item().

Here is the caller graph for this function:

◆ cache_bucket_push()

static void cache_bucket_push ( uma_cache_t  cache,
uma_cache_bucket_t  bucket,
void *  item 
)
inlinestatic

Definition at line 928 of file uma_core.c.

References uma_bucket::ub_bucket, uma_cache::uc_frees, uma_cache_bucket::ucb_bucket, and uma_cache_bucket::ucb_cnt.

Referenced by uma_zfree_arg(), and uma_zfree_smr().

Here is the caller graph for this function:

◆ cache_bucket_swap()

static void cache_bucket_swap ( uma_cache_bucket_t  b1,
uma_cache_bucket_t  b2 
)
inlinestatic

Definition at line 1035 of file uma_core.c.

References cache_bucket_copy().

Referenced by cache_alloc(), and uma_zfree_arg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_bucket_unload()

static uma_bucket_t cache_bucket_unload ( uma_cache_bucket_t  bucket)
inlinestatic

◆ cache_bucket_unload_alloc()

static uma_bucket_t cache_bucket_unload_alloc ( uma_cache_t  cache)
inlinestatic

Definition at line 960 of file uma_core.c.

References cache_bucket_unload(), and uma_cache::uc_allocbucket.

Referenced by cache_alloc(), cache_drain(), and cache_drain_safe_cpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_bucket_unload_cross()

static uma_bucket_t cache_bucket_unload_cross ( uma_cache_t  cache)
inlinestatic

Definition at line 974 of file uma_core.c.

References cache_bucket_unload(), and uma_cache::uc_crossbucket.

Referenced by cache_drain(), and cache_drain_safe_cpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_bucket_unload_free()

static uma_bucket_t cache_bucket_unload_free ( uma_cache_t  cache)
inlinestatic

Definition at line 967 of file uma_core.c.

References cache_bucket_unload(), and uma_cache::uc_freebucket.

Referenced by cache_drain(), and cache_drain_safe_cpu().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_drain()

static void cache_drain ( uma_zone_t  zone)
static

Definition at line 1390 of file uma_core.c.

References bucket_cache_reclaim(), bucket_free(), cache_bucket_unload_alloc(), cache_bucket_unload_cross(), cache_bucket_unload_free(), uma_bucket::ub_seq, UMA_ANYDOMAIN, UMA_ZONE_SMR, uma_zone::uz_cpu, uma_zone::uz_flags, and uma_zone::uz_smr.

Referenced by zone_dtor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_drain_safe_cpu()

static void cache_drain_safe_cpu ( uma_zone_t  zone,
void *  unused 
)
static

Definition at line 1441 of file uma_core.c.

References cache_bucket_unload_alloc(), cache_bucket_unload_cross(), cache_bucket_unload_free(), UMA_ZFLAG_INTERNAL, UMA_ZONE_SMR, uma_zone::uz_cpu, uma_zone::uz_flags, vm_ndomains, and zone_free_bucket().

Referenced by pcpu_cache_drain_safe().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_fetch_bucket()

static uma_bucket_t cache_fetch_bucket ( uma_zone_t  zone,
uma_cache_t  cache,
int  domain 
)
static

Definition at line 1050 of file uma_core.c.

References cache_uz_flags(), UMA_ZONE_SMR, uma_zone::uz_smr, uma_zone_domain::uzd_nitems, uma_zone_domain::uzd_seq, ZDOM_GET, ZDOM_UNLOCK, zone_domain_lock(), and zone_fetch_bucket().

Referenced by cache_alloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cache_free()

◆ cache_shrink()

static void cache_shrink ( uma_zone_t  zone,
void *  unused 
)
static

Definition at line 1428 of file uma_core.c.

References UMA_ZFLAG_INTERNAL, uma_zone::uz_bucket_size, uma_zone::uz_bucket_size_min, uma_zone::uz_flags, ZONE_LOCK, and ZONE_UNLOCK.

Referenced by pcpu_cache_drain_safe().

Here is the caller graph for this function:

◆ contig_alloc()

static void * contig_alloc ( uma_zone_t  zone,
vm_size_t  bytes,
int  domain,
uint8_t *  pflag,
int  wait 
)
static

Definition at line 2068 of file uma_core.c.

References kmem_alloc_contig_domainset(), and UMA_SLAB_KERNEL.

Referenced by keg_ctor(), and zone_kva_available().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hash_alloc()

static int hash_alloc ( struct uma_hash hash,
u_int  size 
)
static

Definition at line 1246 of file uma_core.c.

References hashzone, uma_hash::uh_hashmask, uma_hash::uh_hashsize, uma_hash::uh_slab_hash, UMA_ANYDOMAIN, UMA_HASH_SIZE_INIT, and zone_alloc_item().

Referenced by keg_ctor(), and zone_timeout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hash_expand()

static int hash_expand ( struct uma_hash oldhash,
struct uma_hash newhash 
)
static

Definition at line 1285 of file uma_core.c.

References uma_hash::uh_hashsize, uma_hash::uh_slab_hash, uma_hash_slab::uhs_data, and UMA_HASH.

Referenced by zone_timeout().

Here is the caller graph for this function:

◆ hash_free()

static void hash_free ( struct uma_hash hash)
static

Definition at line 1325 of file uma_core.c.

References hashzone, SKIP_NONE, uma_hash::uh_hashsize, uma_hash::uh_slab_hash, UMA_HASH_SIZE_INIT, and zone_free_item().

Referenced by keg_dtor(), and zone_timeout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ item_ctor()

static void * item_ctor ( uma_zone_t  zone,
int  uz_flags,
int  size,
void *  udata,
int  flags,
void *  item 
)
inlinestatic

◆ item_dtor()

static void item_dtor ( uma_zone_t  zone,
void *  item,
int  size,
void *  udata,
enum zfreeskip  skip 
)
inlinestatic

Definition at line 3457 of file uma_core.c.

References kasan_mark_item_invalid(), uma_zctor_args::size, SKIP_DTOR, SKIP_NONE, trash_dtor(), UMA_ZFLAG_TRASH, UMA_ZONE_MALLOC, uma_zone::uz_dtor, and uma_zone::uz_flags.

Referenced by bucket_drain(), uma_zfree_arg(), zone_fetch_bucket(), and zone_free_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kasan_mark_item_invalid()

static void kasan_mark_item_invalid ( uma_zone_t zone  __unused,
void *item  __unused 
)
static

Definition at line 621 of file uma_core.c.

Referenced by bucket_drain(), item_dtor(), zone_alloc_bucket(), zone_alloc_item(), and zone_free_item().

Here is the caller graph for this function:

◆ kasan_mark_item_valid()

static void kasan_mark_item_valid ( uma_zone_t zone  __unused,
void *item  __unused 
)
static

Definition at line 616 of file uma_core.c.

Referenced by bucket_drain(), item_ctor(), zone_alloc_bucket(), zone_alloc_item(), and zone_free_item().

Here is the caller graph for this function:

◆ kasan_mark_slab_invalid()

static void kasan_mark_slab_invalid ( uma_keg_t keg  __unused,
void *mem  __unused 
)
static

Definition at line 631 of file uma_core.c.

Referenced by keg_alloc_slab().

Here is the caller graph for this function:

◆ kasan_mark_slab_valid()

static void kasan_mark_slab_valid ( uma_keg_t keg  __unused,
void *mem  __unused 
)
static

Definition at line 626 of file uma_core.c.

Referenced by keg_free_slab().

Here is the caller graph for this function:

◆ keg_alloc_slab()

◆ keg_ctor()

◆ keg_drain()

static void keg_drain ( uma_keg_t  keg,
int  domain 
)
static

Definition at line 1697 of file uma_core.c.

References keg_drain_domain(), uma_keg::uk_flags, UMA_ANYDOMAIN, UMA_ZONE_NOFREE, and vm_ndomains.

Referenced by zone_reclaim(), and zone_timeout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keg_drain_domain()

static void keg_drain_domain ( uma_keg_t  keg,
int  domain 
)
static

Definition at line 1634 of file uma_core.c.

References keg_free_slab(), KEG_LOCK, KEG_UNLOCK, uma_keg::uk_domain, uma_keg::uk_flags, uma_keg::uk_hash, uma_keg::uk_ipers, uma_keg::uk_name, uma_keg::uk_ppera, uma_keg::uk_reserve, UMA_HASH_REMOVE, and UMA_ZFLAG_HASH.

Referenced by keg_drain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keg_dtor()

static void keg_dtor ( void *  arg,
int  size,
void *  udata 
)
static

Definition at line 2969 of file uma_core.c.

References hash_free(), KEG_LOCK_FINI, uma_domain::ud_free_items, uma_domain::ud_pages, uma_keg::uk_domain, uma_keg::uk_hash, uma_keg::uk_ipers, uma_keg::uk_name, uma_keg::uk_ppera, and vm_ndomains.

Referenced by uma_startup1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keg_fetch_free_slab()

static uma_slab_t keg_fetch_free_slab ( uma_keg_t  keg,
int  domain,
bool  rr,
int  flags 
)
static

Definition at line 3880 of file uma_core.c.

References uma_zctor_args::flags, uma_zctor_args::keg, keg_first_slab(), KEG_LOCK, KEG_UNLOCK, uma_domain::ud_free_items, uma_keg::uk_domain, uma_keg::uk_flags, uma_keg::uk_reserve, and UMA_ZFLAG_HASH.

Referenced by keg_fetch_slab().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keg_fetch_slab()

static uma_slab_t keg_fetch_slab ( uma_keg_t  keg,
uma_zone_t  zone,
int  rdomain,
const int  flags 
)
static

Definition at line 3900 of file uma_core.c.

References keg_alloc_slab(), keg_fetch_free_slab(), uma_keg::uk_dr, UMA_ANYDOMAIN, vm_domainset_iter_policy(), vm_domainset_iter_policy_ref_init(), vm_wait_domain(), and vm_wait_doms().

Referenced by zone_import().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keg_first_slab()

static uma_slab_t keg_first_slab ( uma_keg_t  keg,
int  domain,
bool  rr 
)
static

Definition at line 3846 of file uma_core.c.

References uma_zctor_args::keg, KEG_LOCK_ASSERT, uma_domain::ud_free_slab, uma_domain::ud_free_slabs, uma_domain::ud_part_slab, uma_keg::uk_domain, and vm_ndomains.

Referenced by keg_fetch_free_slab().

Here is the caller graph for this function:

◆ keg_free_slab()

static void keg_free_slab ( uma_keg_t  keg,
uma_slab_t  slab,
int  start 
)
static

◆ keg_layout()

◆ keg_layout_one()

static void keg_layout_one ( uma_keg_t  keg,
u_int  rsize,
u_int  slabsize,
u_int  fmt,
struct keg_layout_result kl 
)
static

Definition at line 2220 of file uma_core.c.

References keg_layout_result::eff, keg_layout_result::format, keg_layout_result::ipers, slab_ipers_hdr(), keg_layout_result::slabsize, slabzone(), uma_keg::uk_rsize, uma_keg::uk_size, UMA_FRAC_FIXPT, UMA_ZFLAG_INTERNAL, UMA_ZFLAG_OFFPAGE, and uma_zone::uz_keg.

Referenced by keg_layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kmsan_mark_item_uninitialized()

static void kmsan_mark_item_uninitialized ( uma_zone_t zone  __unused,
void *item  __unused 
)
inlinestatic

Definition at line 685 of file uma_core.c.

Referenced by item_ctor().

Here is the caller graph for this function:

◆ LIST_HEAD()

static LIST_HEAD ( uma_keg  )
static

Definition at line 166 of file uma_core.c.

◆ MALLOC_DEFINE() [1/2]

static MALLOC_DEFINE ( M_UMA  ,
"UMA"  ,
"UMA Misc"   
)
static

◆ MALLOC_DEFINE() [2/2]

static MALLOC_DEFINE ( M_UMAHASH  ,
"UMAHash"  ,
"UMA Hash Buckets"   
)
static

◆ noobj_alloc()

static void * noobj_alloc ( uma_zone_t  zone,
vm_size_t  bytes,
int  domain,
uint8_t *  flags,
int  wait 
)
static

Definition at line 2014 of file uma_core.c.

References pmap_qenter(), TAILQ_HEAD(), uma_keg::uk_kva, uma_keg::uk_offset, UMA_SLAB_PRIV, uma_zone::uz_keg, VM_ALLOC_INTERRUPT, VM_ALLOC_WAITOK, VM_ALLOC_WIRED, vm_page_alloc_noobj_domain(), vm_page_free(), and vm_page_unwire_noq().

Referenced by uma_zone_reserve_kva().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ page_alloc()

static void * page_alloc ( uma_zone_t  zone,
vm_size_t  bytes,
int  domain,
uint8_t *  pflag,
int  wait 
)
static

Definition at line 1937 of file uma_core.c.

References kmem_malloc_domainset(), and UMA_SLAB_KERNEL.

Referenced by keg_ctor(), and zone_kva_available().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ page_free()

static void page_free ( void *  mem,
vm_size_t  size,
uint8_t  flags 
)
static

Definition at line 2089 of file uma_core.c.

References kmem_free(), startup_free(), UMA_SLAB_BOOT, and UMA_SLAB_KERNEL.

Referenced by keg_ctor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcpu_cache_drain_safe()

static void pcpu_cache_drain_safe ( uma_zone_t  zone)
static

Definition at line 1485 of file uma_core.c.

References cache_drain_safe_cpu(), cache_shrink(), and zone_foreach().

Referenced by uma_reclaim_domain(), and uma_zone_reclaim_domain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcpu_page_alloc()

static void * pcpu_page_alloc ( uma_zone_t  zone,
vm_size_t  bytes,
int  domain,
uint8_t *  pflag,
int  wait 
)
static

Definition at line 1949 of file uma_core.c.

References kva_alloc(), pmap_qenter(), UMA_SLAB_KERNEL, VM_ALLOC_SYSTEM, VM_ALLOC_WIRED, VM_DOMAIN_EMPTY, vm_page_alloc_noobj(), vm_page_alloc_noobj_domain(), vm_page_free(), and vm_page_unwire_noq().

Referenced by keg_ctor(), and zone_kva_available().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pcpu_page_free()

static void pcpu_page_free ( void *  mem,
vm_size_t  size,
uint8_t  flags 
)
static

Definition at line 2115 of file uma_core.c.

References kva_free(), PHYS_TO_VM_PAGE(), pmap_qremove(), startup_free(), UMA_SLAB_BOOT, vm_page_free(), and vm_page_unwire_noq().

Referenced by keg_ctor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slab_alloc_item()

static void * slab_alloc_item ( uma_keg_t  keg,
uma_slab_t  slab 
)
static

Definition at line 3978 of file uma_core.c.

References KEG_LOCK_ASSERT, slab_item(), uma_domain::ud_free_items, uma_domain::ud_full_slab, uma_keg::uk_domain, uma_keg::uk_ipers, uma_slab::us_domain, uma_slab::us_free, and uma_slab::us_freecount.

Referenced by zone_import().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slab_free_item()

static void slab_free_item ( uma_zone_t  zone,
uma_slab_t  slab,
void *  item 
)
static

◆ slab_ipers_hdr()

static u_int slab_ipers_hdr ( u_int  size,
u_int  rsize,
u_int  slabsize,
bool  hdr 
)
static

Definition at line 2186 of file uma_core.c.

References SLAB_MAX_SETSIZE, and slab_sizeof().

Referenced by keg_layout_one().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ slab_sizeof()

static size_t slab_sizeof ( int  nitems)
static

Definition at line 2164 of file uma_core.c.

References SLAB_BITSETS, and UMA_ALIGN_PTR.

Referenced by keg_ctor(), and slab_ipers_hdr().

Here is the caller graph for this function:

◆ slabzone()

static uma_zone_t slabzone ( int  ipers)
inlinestatic

Definition at line 394 of file uma_core.c.

References SLABZONE0_SETSIZE, and slabzones.

Referenced by keg_alloc_slab(), keg_free_slab(), keg_layout_one(), and sysctl_handle_uma_slab_efficiency().

Here is the caller graph for this function:

◆ startup_alloc()

static void * startup_alloc ( uma_zone_t  zone,
vm_size_t  bytes,
int  domain,
uint8_t *  pflag,
int  wait 
)
static

Definition at line 1869 of file uma_core.c.

References dump_add_page, pmap_map(), UMA_SLAB_BOOT, VM_ALLOC_WIRED, vm_page_alloc_noobj_contig_domain(), VM_PAGE_TO_PHYS, VM_PROT_READ, and VM_PROT_WRITE.

Referenced by keg_ctor(), uma_startup1(), and zone_kva_available().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startup_free()

static void startup_free ( void *  mem,
vm_size_t  bytes 
)
static

Definition at line 1901 of file uma_core.c.

References dump_drop_page, PHYS_TO_VM_PAGE(), pmap_remove(), vm_page_free(), VM_PAGE_TO_PHYS, and vm_page_unwire_noq().

Referenced by page_free(), and pcpu_page_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysctl_handle_uma_slab_efficiency()

static int sysctl_handle_uma_slab_efficiency ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 5600 of file uma_core.c.

References slabzone(), uma_keg::uk_align, uma_keg::uk_flags, uma_keg::uk_ipers, uma_keg::uk_ppera, uma_keg::uk_rsize, uma_keg::uk_size, UMA_ZFLAG_OFFPAGE, UMA_ZONE_PCPU, and uma_zone::uz_keg.

Referenced by zone_alloc_sysctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysctl_handle_uma_zone_allocs()

static int sysctl_handle_uma_zone_allocs ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 5562 of file uma_core.c.

References uma_zone_get_allocs().

Referenced by zone_alloc_sysctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysctl_handle_uma_zone_cur()

int sysctl_handle_uma_zone_cur ( SYSCTL_HANDLER_ARGS  )

Definition at line 5544 of file uma_core.c.

References uma_zone_get_cur().

Referenced by zone_alloc_sysctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysctl_handle_uma_zone_flags()

static int sysctl_handle_uma_zone_flags ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 5582 of file uma_core.c.

References PRINT_UMA_ZFLAGS.

Referenced by zone_alloc_sysctl().

Here is the caller graph for this function:

◆ sysctl_handle_uma_zone_frees()

static int sysctl_handle_uma_zone_frees ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 5572 of file uma_core.c.

References uma_zone_get_frees().

Referenced by zone_alloc_sysctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sysctl_handle_uma_zone_items()

static int sysctl_handle_uma_zone_items ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 5621 of file uma_core.c.

References uma_zone::uz_items, and UZ_ITEMS_COUNT.

Referenced by zone_alloc_sysctl().

Here is the caller graph for this function:

◆ sysctl_handle_uma_zone_max()

int sysctl_handle_uma_zone_max ( SYSCTL_HANDLER_ARGS  )

Definition at line 5528 of file uma_core.c.

References uma_zone_get_max(), and uma_zone_set_max().

Here is the call graph for this function:

◆ SYSCTL_INT() [1/2]

SYSCTL_INT ( _vm  ,
OID_AUTO  ,
zone_warnings  ,
CTLFLAG_RWTUN  ,
zone_warnings,
,
"Warn when UMA zones becomes full"   
)

◆ SYSCTL_INT() [2/2]

SYSCTL_INT ( _vm_debug  ,
OID_AUTO  ,
uma_multipage_slabs  ,
CTLFLAG_RDTUN|  CTLFLAG_NOFETCH,
multipage_slabs,
,
"UMA may choose larger slab sizes for better efficiency"   
)

◆ SYSCTL_NODE() [1/2]

static SYSCTL_NODE ( _vm  ,
OID_AUTO  ,
debug  ,
CTLFLAG_RD|  CTLFLAG_MPSAFE,
,
"Memory allocation debugging"   
)
static

◆ SYSCTL_NODE() [2/2]

SYSCTL_NODE ( _vm  ,
OID_AUTO  ,
uma  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"Universal Memory Allocator"   
)

◆ SYSCTL_PROC() [1/2]

SYSCTL_PROC ( _vm  ,
OID_AUTO  ,
zone_count  ,
CTLFLAG_RD|CTLFLAG_MPSAFE|  CTLTYPE_INT,
,
,
sysctl_vm_zone_count  ,
"I"  ,
"Number of UMA zones  
)

◆ SYSCTL_PROC() [2/2]

SYSCTL_PROC ( _vm  ,
OID_AUTO  ,
zone_stats  ,
CTLFLAG_RD|CTLFLAG_MPSAFE|  CTLTYPE_STRUCT,
,
,
sysctl_vm_zone_stats  ,
s,
struct uma_type_header ,
"Zone Stats"   
)

◆ sysctl_vm_zone_count()

static int sysctl_vm_zone_count ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 5384 of file uma_core.c.

References uma_reclaim_args::req.

◆ sysctl_vm_zone_stats()

◆ SYSINIT() [1/2]

SYSINIT ( uma_startup3  ,
SI_SUB_VM_CONF  ,
SI_ORDER_SECOND  ,
uma_startup3  ,
NULL   
)

◆ SYSINIT() [2/2]

SYSINIT ( uma_startup_pcpu  ,
SI_SUB_COUNTER  ,
SI_ORDER_ANY  ,
uma_startup_pcpu  ,
NULL   
)

◆ TUNABLE_INT()

TUNABLE_INT ( "vm.debug.uma_multipage_slabs"  ,
multipage_slabs 
)

◆ uma_avail()

long uma_avail ( void  )

Definition at line 5332 of file uma_core.c.

References uma_kmem_limit, and uma_size().

Here is the call graph for this function:

◆ uma_kcreate()

static uma_keg_t uma_kcreate ( uma_zone_t  zone,
size_t  size,
uma_init  uminit,
uma_fini  fini,
int  align,
uint32_t  flags 
)
static

Definition at line 3225 of file uma_core.c.

References uma_kctor_args::align, uma_kctor_args::fini, uma_kctor_args::flags, kegs, uma_kctor_args::size, UMA_ALIGN_CACHE, uma_align_cache, UMA_ANYDOMAIN, uma_kctor_args::uminit, uma_kctor_args::zone, and zone_alloc_item().

Referenced by zone_ctor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_limit()

unsigned long uma_limit ( void  )

Definition at line 5311 of file uma_core.c.

References uma_kmem_limit.

◆ uma_prealloc()

void uma_prealloc ( uma_zone_t  zone,
int  items 
)

Definition at line 5133 of file uma_core.c.

References keg_alloc_slab(), KEG_GET, KEG_UNLOCK, uma_keg::uk_domain, uma_keg::uk_dr, uma_keg::uk_ipers, uma_slab::us_domain, vm_domainset_iter_policy(), vm_domainset_iter_policy_ref_init(), and vm_wait_doms().

Referenced by _vm_map_unlock(), pbuf_prealloc(), pbuf_zsecond_create(), and vm_map_startup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_reclaim()

void uma_reclaim ( int  req)

Definition at line 5207 of file uma_core.c.

References uma_reclaim_args::req, UMA_ANYDOMAIN, and uma_reclaim_domain().

Referenced by debug_uma_reclaim(), uma_reclaim_wakeup(), uma_reclaim_worker(), and vm_pageout_lowmem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_reclaim_domain()

void uma_reclaim_domain ( int  req,
int  domain 
)

◆ uma_reclaim_domain_cb()

static void uma_reclaim_domain_cb ( uma_zone_t  zone,
void *  arg 
)
static

Definition at line 5196 of file uma_core.c.

References uma_reclaim_args::domain, uma_reclaim_args::req, uma_zone_reclaim_domain(), UMA_ZONE_UNMANAGED, and uma_zone::uz_flags.

Referenced by uma_reclaim_domain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_reclaim_wakeup()

void uma_reclaim_wakeup ( void  )

Definition at line 5251 of file uma_core.c.

References uma_reclaim(), and uma_reclaim_needed.

Referenced by vm_pageout_lowmem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_reclaim_worker()

void uma_reclaim_worker ( void *arg  __unused)

Definition at line 5259 of file uma_core.c.

References uma_reclaim(), UMA_RECLAIM_DRAIN_CPU, uma_reclaim_needed, and VM_LOW_KMEM.

Here is the call graph for this function:

◆ uma_set_align()

void uma_set_align ( int  align)

Definition at line 3242 of file uma_core.c.

References uma_kctor_args::align, UMA_ALIGN_CACHE, and uma_align_cache.

◆ uma_set_limit()

void uma_set_limit ( unsigned long  limit)

Definition at line 5318 of file uma_core.c.

References uma_kmem_limit.

◆ uma_shutdown()

static void uma_shutdown ( void  )
static

Definition at line 3218 of file uma_core.c.

References booted.

Referenced by uma_startup3().

Here is the caller graph for this function:

◆ uma_size()

unsigned long uma_size ( void  )

Definition at line 5325 of file uma_core.c.

References uma_kmem_total.

Referenced by uma_avail().

Here is the caller graph for this function:

◆ uma_startup1()

◆ uma_startup2()

void uma_startup2 ( void  )

Definition at line 3162 of file uma_core.c.

References booted, bucket_enable(), kernel_map, MAP_NOFAULT, vm_map_insert(), vm_map_lock, vm_map_unlock, VM_PROT_RW, vm_radix_reserve_kva(), zone_foreach_unlocked(), and zone_kva_available().

Referenced by kmem_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_startup3()

static void uma_startup3 ( void *arg  __unused)
static

Definition at line 3199 of file uma_core.c.

References booted, uma_callout, uma_shutdown(), UMA_TIMEOUT, uma_timeout(), zone_alloc_sysctl(), and zone_foreach_unlocked().

Here is the call graph for this function:

◆ uma_startup_pcpu()

static void uma_startup_pcpu ( void *arg  __unused)
static

Definition at line 3187 of file uma_core.c.

References booted, zone_alloc_counters(), and zone_foreach_unlocked().

Here is the call graph for this function:

◆ uma_timeout()

static void uma_timeout ( void *  unused)
static

Definition at line 1110 of file uma_core.c.

References bucket_enable(), uma_callout, UMA_TIMEOUT, uma_timeout(), zone_foreach(), and zone_timeout().

Referenced by uma_startup3(), and uma_timeout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_vm_zone_stats()

◆ uma_zalloc_arg()

void * uma_zalloc_arg ( uma_zone_t  zone,
void *  udata,
int  flags 
)

Definition at line 3637 of file uma_core.c.

References cache_alloc_item(), cache_alloc_retry(), uma_zctor_args::flags, uma_cache::uc_allocbucket, uma_cache_bucket::ucb_cnt, UMA_ZONE_SMR, uma_zone::uz_cpu, uma_zone::uz_flags, and uma_zone::uz_name.

Referenced by bucket_alloc(), uma_zalloc_domain(), and uma_zalloc_pcpu_arg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_zalloc_domain()

void * uma_zalloc_domain ( uma_zone_t  zone,
void *  udata,
int  domain,
int  flags 
)

◆ uma_zalloc_pcpu_arg()

void * uma_zalloc_pcpu_arg ( uma_zone_t  zone,
void *  udata,
int  flags 
)

Definition at line 3377 of file uma_core.c.

References uma_zctor_args::flags, uma_zalloc_arg(), UMA_ZONE_PCPU, uma_zone::uz_flags, and uma_zone::uz_size.

Here is the call graph for this function:

◆ uma_zalloc_smr()

void * uma_zalloc_smr ( uma_zone_t  zone,
int  flags 
)

Definition at line 3610 of file uma_core.c.

References cache_alloc_item(), cache_alloc_retry(), uma_zctor_args::flags, uma_cache::uc_allocbucket, uma_cache_bucket::ucb_cnt, UMA_ZONE_SMR, uma_zone::uz_cpu, uma_zone::uz_flags, and uma_zone::uz_name.

Referenced by uma_zwait(), and vm_radix_node_get().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_zcache_create()

uma_zone_t uma_zcache_create ( const char *  name,
int  size,
uma_ctor  ctor,
uma_dtor  dtor,
uma_init  zinit,
uma_fini  zfini,
uma_import  zimport,
uma_release  zrelease,
void *  arg,
int  flags 
)

◆ uma_zcreate()

uma_zone_t uma_zcreate ( const char *  name,
size_t  size,
uma_ctor  ctor,
uma_dtor  dtor,
uma_init  uminit,
uma_fini  fini,
int  align,
uint32_t  flags 
)

◆ uma_zdestroy()

void uma_zdestroy ( uma_zone_t  zone)

Definition at line 3349 of file uma_core.c.

References booted, SKIP_NONE, uma_zone::uz_fini, uma_zone::uz_release, zone_free_item(), zone_release(), and zones.

Here is the call graph for this function:

◆ uma_zfree_arg()

◆ uma_zfree_pcpu_arg()

void uma_zfree_pcpu_arg ( uma_zone_t  zone,
void *  pcpu_item,
void *  udata 
)

Definition at line 3404 of file uma_core.c.

References uma_zfree_arg(), UMA_ZONE_PCPU, and uma_zone::uz_flags.

Here is the call graph for this function:

◆ uma_zfree_smr()

void uma_zfree_smr ( uma_zone_t  zone,
void *  item 
)

◆ uma_zone_exhausted()

int uma_zone_exhausted ( uma_zone_t  zone)

Definition at line 5304 of file uma_core.c.

References uma_zone::uz_sleepers.

Referenced by swp_pager_meta_build().

Here is the caller graph for this function:

◆ uma_zone_get_allocs()

static uint64_t uma_zone_get_allocs ( uma_zone_t  zone)
static

Definition at line 4950 of file uma_core.c.

References uma_cache::uc_allocs, uma_zone::uz_allocs, and uma_zone::uz_cpu.

Referenced by sysctl_handle_uma_zone_allocs().

Here is the caller graph for this function:

◆ uma_zone_get_cur()

int uma_zone_get_cur ( uma_zone_t  zone)

Definition at line 4933 of file uma_core.c.

References uma_cache::uc_allocs, uma_cache::uc_frees, uma_zone::uz_allocs, uma_zone::uz_cpu, and uma_zone::uz_frees.

Referenced by sysctl_handle_uma_zone_cur().

Here is the caller graph for this function:

◆ uma_zone_get_frees()

static uint64_t uma_zone_get_frees ( uma_zone_t  zone)
static

Definition at line 4965 of file uma_core.c.

References uma_cache::uc_frees, uma_zone::uz_cpu, and uma_zone::uz_frees.

Referenced by sysctl_handle_uma_zone_frees().

Here is the caller graph for this function:

◆ uma_zone_get_max()

int uma_zone_get_max ( uma_zone_t  zone)

Definition at line 4904 of file uma_core.c.

References uma_zone::uz_max_items.

Referenced by swap_pager_swap_init(), and sysctl_handle_uma_zone_max().

Here is the caller graph for this function:

◆ uma_zone_get_smr()

smr_t uma_zone_get_smr ( uma_zone_t  zone)

Definition at line 5073 of file uma_core.c.

References uma_zone::uz_smr.

Referenced by vm_radix_zinit().

Here is the caller graph for this function:

◆ uma_zone_memory()

◆ uma_zone_reclaim()

void uma_zone_reclaim ( uma_zone_t  zone,
int  req 
)

Definition at line 5278 of file uma_core.c.

References uma_reclaim_args::req, UMA_ANYDOMAIN, and uma_zone_reclaim_domain().

Here is the call graph for this function:

◆ uma_zone_reclaim_domain()

void uma_zone_reclaim_domain ( uma_zone_t  zone,
int  req,
int  domain 
)

Definition at line 5284 of file uma_core.c.

References uma_reclaim_args::domain, pcpu_cache_drain_safe(), uma_reclaim_args::req, UMA_RECLAIM_DRAIN, UMA_RECLAIM_DRAIN_CPU, UMA_RECLAIM_TRIM, and zone_reclaim().

Referenced by bucket_zone_drain(), uma_reclaim_domain(), uma_reclaim_domain_cb(), and uma_zone_reclaim().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_zone_reserve()

void uma_zone_reserve ( uma_zone_t  zone,
int  items 
)

Definition at line 5081 of file uma_core.c.

References KEG_ASSERT_COLD, KEG_GET, and uma_keg::uk_reserve.

Referenced by vm_map_startup().

Here is the caller graph for this function:

◆ uma_zone_reserve_kva()

int uma_zone_reserve_kva ( uma_zone_t  zone,
int  count 
)

◆ uma_zone_set_allocf()

void uma_zone_set_allocf ( uma_zone_t  zone,
uma_alloc  allocf 
)

Definition at line 5048 of file uma_core.c.

References KEG_ASSERT_COLD, KEG_GET, and uma_keg::uk_allocf.

Referenced by vm_map_startup().

Here is the caller graph for this function:

◆ uma_zone_set_fini()

void uma_zone_set_fini ( uma_zone_t  zone,
uma_fini  fini 
)

Definition at line 5008 of file uma_core.c.

References KEG_ASSERT_COLD, KEG_GET, and uma_keg::uk_fini.

◆ uma_zone_set_freef()

void uma_zone_set_freef ( uma_zone_t  zone,
uma_free  freef 
)

Definition at line 5037 of file uma_core.c.

References KEG_ASSERT_COLD, KEG_GET, and uma_keg::uk_freef.

Referenced by vm_map_startup().

Here is the caller graph for this function:

◆ uma_zone_set_init()

void uma_zone_set_init ( uma_zone_t  zone,
uma_init  uminit 
)

Definition at line 4997 of file uma_core.c.

References KEG_ASSERT_COLD, KEG_GET, and uma_keg::uk_init.

◆ uma_zone_set_max()

int uma_zone_set_max ( uma_zone_t  zone,
int  nitems 
)

Definition at line 4841 of file uma_core.c.

References UMA_ZFLAG_LIMIT, uma_zone_set_maxcache(), uma_zone::uz_flags, uma_zone::uz_max_items, ZONE_LOCK, ZONE_UNLOCK, and zone_update_caches().

Referenced by pbuf_zsecond_create(), sysctl_handle_uma_zone_max(), and vm_pager_bufferinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uma_zone_set_maxaction()

void uma_zone_set_maxaction ( uma_zone_t  zone,
uma_maxaction_t  maxaction 
)

Definition at line 4924 of file uma_core.c.

References uma_zone::uz_maxaction, and ZONE_ASSERT_COLD.

◆ uma_zone_set_maxcache()

◆ uma_zone_set_smr()

void uma_zone_set_smr ( uma_zone_t  zone,
smr_t  smr 
)

Definition at line 5059 of file uma_core.c.

References UMA_ZONE_SMR, uma_zone::uz_flags, uma_zone::uz_name, uma_zone::uz_smr, ZONE_ASSERT_COLD, and zone_update_caches().

Here is the call graph for this function:

◆ uma_zone_set_warning()

void uma_zone_set_warning ( uma_zone_t  zone,
const char *  warning 
)

Definition at line 4915 of file uma_core.c.

References uma_zone::uz_warning, and ZONE_ASSERT_COLD.

◆ uma_zone_set_zfini()

void uma_zone_set_zfini ( uma_zone_t  zone,
uma_fini  zfini 
)

Definition at line 5028 of file uma_core.c.

References uma_zone::uz_fini, and ZONE_ASSERT_COLD.

◆ uma_zone_set_zinit()

void uma_zone_set_zinit ( uma_zone_t  zone,
uma_init  zinit 
)

Definition at line 5019 of file uma_core.c.

References uma_zone::uz_init, and ZONE_ASSERT_COLD.

◆ uma_zsecond_create()

uma_zone_t uma_zsecond_create ( const char *  name,
uma_ctor  ctor,
uma_dtor  dtor,
uma_init  zinit,
uma_fini  zfini,
uma_zone_t  primary 
)

◆ uma_zwait()

void uma_zwait ( uma_zone_t  zone)

Definition at line 3365 of file uma_core.c.

References uma_zalloc(), uma_zalloc_pcpu(), uma_zalloc_smr(), uma_zfree(), uma_zfree_pcpu(), uma_zfree_smr(), UMA_ZONE_PCPU, UMA_ZONE_SMR, and uma_zone::uz_flags.

Referenced by swp_pager_meta_build(), and vm_radix_wait().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vm_radix_reserve_kva()

void vm_radix_reserve_kva ( void  )

Definition at line 354 of file vm_radix.c.

References uma_zone_reserve_kva(), vm_cnt, and vm_radix_node_zone.

Referenced by uma_startup2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zero_init()

static int zero_init ( void *  mem,
int  size,
int  flags 
)
static

Definition at line 2145 of file uma_core.c.

Referenced by keg_ctor(), and uma_startup1().

Here is the caller graph for this function:

◆ zone_alloc_bucket()

◆ zone_alloc_counters()

static void zone_alloc_counters ( uma_zone_t  zone,
void *  unused 
)
static

Definition at line 2572 of file uma_core.c.

References uma_zone::uz_allocs, uma_zone::uz_fails, uma_zone::uz_frees, uma_zone::uz_xdomain, and uma_kctor_args::zone.

Referenced by uma_startup_pcpu(), and zone_ctor().

Here is the caller graph for this function:

◆ zone_alloc_item()

◆ zone_alloc_limit()

static int zone_alloc_limit ( uma_zone_t  zone,
int  count,
int  flags 
)
static

Definition at line 4163 of file uma_core.c.

References uma_zone::uz_items, uma_zone::uz_max_items, zone_alloc_limit_hard(), and zone_free_limit().

Referenced by zone_alloc_bucket(), and zone_alloc_item().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_alloc_limit_hard()

static int zone_alloc_limit_hard ( uma_zone_t  zone,
int  count,
int  flags 
)
static

Definition at line 4066 of file uma_core.c.

References uma_zone::uz_items, UZ_ITEMS_COUNT, UZ_ITEMS_SLEEPER, UZ_ITEMS_SLEEPERS, UZ_ITEMS_SLEEPERS_MAX, uma_zone::uz_max_items, uma_zone::uz_sleepers, uma_zone::uz_sleeps, zone_free_limit(), zone_log_warning(), and zone_maxaction().

Referenced by zone_alloc_limit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_alloc_sysctl()

◆ zone_count()

static void zone_count ( uma_zone_t  zone,
void *  arg 
)
static

Definition at line 2769 of file uma_core.c.

References uma_zone_count::count, uma_zone_count::name, uma_zone::uz_name, and uma_zone::uz_namecnt.

Referenced by zone_ctor().

Here is the caller graph for this function:

◆ zone_ctor()

static int zone_ctor ( void *  mem,
int  size,
void *  udata,
int  flags 
)
static

Definition at line 2802 of file uma_core.c.

References uma_zctor_args::align, uma_kctor_args::align, uma_zctor_args::arg, booted, BUCKET_MAX, bucket_select(), uma_zone_count::count, uma_zctor_args::fini, uma_kctor_args::fini, uma_zctor_args::flags, uma_kctor_args::flags, uma_zctor_args::keg, keg_ctor(), uma_zone_count::name, uma_zctor_args::size, uma_kctor_args::size, trash_fini(), trash_init(), uma_keg::uk_flags, uma_keg::uk_size, uma_kcreate(), UMA_ZFLAG_CACHE, UMA_ZFLAG_CTORDTOR, UMA_ZFLAG_INHERIT, UMA_ZFLAG_INTERNAL, UMA_ZFLAG_TRASH, UMA_ZONE_FIRSTTOUCH, UMA_ZONE_INHERIT, UMA_ZONE_MAXBUCKET, UMA_ZONE_MTXCLASS, UMA_ZONE_NOBUCKET, UMA_ZONE_NOFREE, UMA_ZONE_NOKASAN, UMA_ZONE_ROUNDROBIN, UMA_ZONE_SECONDARY, UMA_ZONE_SMR, uma_zctor_args::uminit, uma_kctor_args::uminit, uma_zone::uz_allocs, uma_zone::uz_arg, uma_zone::uz_bucket_max, uma_zone::uz_bucket_size, uma_zone::uz_bucket_size_max, uma_zone::uz_bucket_size_min, uma_zone::uz_ctor, uma_zone::uz_dtor, uma_zone::uz_fails, uma_zone::uz_fini, uma_zone::uz_flags, uma_zone::uz_frees, uma_zone::uz_import, uma_zone::uz_init, uma_zone::uz_keg, uma_zone::uz_name, uma_zone::uz_namecnt, uma_zone::uz_ratecheck, uma_zone::uz_release, uma_zone::uz_size, uma_zone::uz_sleeps, uma_zone::uz_smr, uma_zone::uz_warning, uma_zone_domain::uzd_buckets, vm_ndomains, ZDOM_GET, ZDOM_LOCK_INIT, uma_kctor_args::zone, zone_alloc_counters(), zone_alloc_sysctl(), zone_count(), ZONE_CROSS_LOCK_INIT, zone_foreach(), zone_import(), ZONE_LOCK, zone_release(), ZONE_UNLOCK, and zone_update_caches().

Referenced by uma_startup1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_domain_highest()

static __noinline int zone_domain_highest ( uma_zone_t  zone,
int  pref 
)
static

Definition at line 743 of file uma_core.c.

References BUCKET_MAX, uzd_nitems, vm_ndomains, and ZDOM_GET.

Referenced by cache_alloc().

Here is the caller graph for this function:

◆ zone_domain_imax_set()

static void zone_domain_imax_set ( uma_zone_domain_t  zdom,
int  nitems 
)
static

Definition at line 769 of file uma_core.c.

References uma_zone_domain::uzd_bimin, uma_zone_domain::uzd_imax, and uma_zone_domain::uzd_wss.

Referenced by zone_put_bucket().

Here is the caller graph for this function:

◆ zone_domain_lock()

static uma_zone_domain_t zone_domain_lock ( uma_zone_t  zone,
int  domain 
)
static

Definition at line 694 of file uma_core.c.

References uma_zone::uz_bucket_size, uma_zone::uz_bucket_size_max, ZDOM_GET, ZDOM_LOCK, and ZDOM_OWNED.

Referenced by cache_fetch_bucket(), uma_zalloc_domain(), and zone_put_bucket().

Here is the caller graph for this function:

◆ zone_domain_lowest()

static __noinline int zone_domain_lowest ( uma_zone_t  zone,
int  pref 
)
static

Definition at line 715 of file uma_core.c.

References vm_ndomains, and ZDOM_GET.

Referenced by zone_free_bucket().

Here is the caller graph for this function:

◆ zone_domain_update_wss()

static void zone_domain_update_wss ( uma_zone_domain_t  zdom)
static

◆ zone_dtor()

static void zone_dtor ( void *  arg,
int  size,
void *  udata 
)
static

◆ zone_fetch_bucket()

◆ zone_foreach() [1/2]

static void zone_foreach ( void(*)(uma_zone_t, void *)  zfunc,
void *   
)
static

Referenced by pcpu_cache_drain_safe(), uma_reclaim_domain(), uma_timeout(), and zone_ctor().

Here is the caller graph for this function:

◆ zone_foreach() [2/2]

static void zone_foreach ( void(*)(uma_zone_t, void *arg)  zfunc,
void *  arg 
)
static

Definition at line 3065 of file uma_core.c.

References zone_foreach_unlocked().

Here is the call graph for this function:

◆ zone_foreach_unlocked() [1/2]

static void zone_foreach_unlocked ( void(*)(uma_zone_t, void *)  zfunc,
void *   
)
static

Referenced by uma_startup2(), uma_startup3(), uma_startup_pcpu(), and zone_foreach().

Here is the caller graph for this function:

◆ zone_foreach_unlocked() [2/2]

static void zone_foreach_unlocked ( void(*)(uma_zone_t, void *arg)  zfunc,
void *  arg 
)
static

Definition at line 3041 of file uma_core.c.

References uma_kctor_args::zone.

◆ zone_free_bucket()

static void zone_free_bucket ( uma_zone_t  zone,
uma_bucket_t  bucket,
void *  udata,
int  itemdomain,
bool  ws 
)
static

Definition at line 4603 of file uma_core.c.

References UMA_ZONE_FIRSTTOUCH, UMA_ZONE_ROUNDROBIN, uma_zone::uz_flags, uma_zone::uz_name, vm_ndomains, zone_domain_lowest(), and zone_put_bucket().

Referenced by cache_drain_safe_cpu(), and cache_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_free_item()

static __noinline void zone_free_item ( uma_zone_t  zone,
void *  item,
void *  udata,
enum zfreeskip  skip 
)
static

◆ zone_free_limit()

static void zone_free_limit ( uma_zone_t  zone,
int  count 
)
static

Definition at line 4196 of file uma_core.c.

References uma_zone::uz_items, UZ_ITEMS_COUNT, UZ_ITEMS_SLEEPERS, and uma_zone::uz_max_items.

Referenced by bucket_drain(), zone_alloc_bucket(), zone_alloc_item(), zone_alloc_limit(), zone_alloc_limit_hard(), and zone_free_item().

Here is the caller graph for this function:

◆ zone_import()

static int zone_import ( void *  arg,
void **  bucket,
int  max,
int  domain,
int  flags 
)
static

Definition at line 4007 of file uma_core.c.

References keg_fetch_slab(), KEG_UNLOCK, slab_alloc_item(), uma_domain::ud_free_items, uma_keg::uk_domain, uma_keg::uk_reserve, UMA_ZONE_ROUNDROBIN, uma_slab::us_domain, uma_slab::us_freecount, uma_zone::uz_flags, uma_zone::uz_keg, and vm_ndomains.

Referenced by zone_ctor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_kva_available()

static void zone_kva_available ( uma_zone_t  zone,
void *  unused 
)
static

Definition at line 2551 of file uma_core.c.

References contig_alloc(), KEG_GET, page_alloc(), pcpu_page_alloc(), startup_alloc(), uma_keg::uk_allocf, uma_keg::uk_flags, uma_keg::uk_ppera, UMA_ZFLAG_CACHE, UMA_ZONE_CONTIG, UMA_ZONE_PCPU, uma_zone::uz_flags, and uma_kctor_args::zone.

Referenced by uma_startup2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_log_warning()

static void zone_log_warning ( uma_zone_t  zone)
static

Definition at line 1080 of file uma_core.c.

References uma_zone::uz_name, uma_zone::uz_ratecheck, uma_zone::uz_warning, and zone_warnings.

Referenced by zone_alloc_limit_hard().

Here is the caller graph for this function:

◆ zone_maxaction()

static void zone_maxaction ( uma_zone_t  zone)
inlinestatic

Definition at line 1092 of file uma_core.c.

References uma_zone::uz_maxaction.

Referenced by zone_alloc_limit_hard().

Here is the caller graph for this function:

◆ zone_put_bucket()

static void zone_put_bucket ( uma_zone_t  zone,
int  domain,
uma_bucket_t  bucket,
void *  udata,
const bool  ws 
)
static

◆ zone_reclaim()

static void zone_reclaim ( uma_zone_t  zone,
int  domain,
int  waitok,
bool  drain 
)
static

Definition at line 1712 of file uma_core.c.

References bucket_cache_reclaim(), keg_drain(), UMA_ZFLAG_CACHE, uma_zone::uz_flags, uma_zone::uz_keg, uma_zone::uz_reclaimers, ZONE_LOCK, ZONE_LOCKPTR, and ZONE_UNLOCK.

Referenced by uma_zone_reclaim_domain(), and zone_dtor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_release()

static void zone_release ( void *  arg,
void **  bucket,
int  cnt 
)
static

Definition at line 4761 of file uma_core.c.

References hash_sfind(), KEG_LOCK, KEG_LOCKPTR, slab_free_item(), uma_keg::uk_hash, uma_keg::uk_pgoff, UMA_ZFLAG_HASH, UMA_ZFLAG_VTOSLAB, uma_slab::us_domain, uma_zone::uz_flags, uma_zone::uz_keg, and vtoslab().

Referenced by uma_zdestroy(), and zone_ctor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zone_timeout()

static void zone_timeout ( uma_zone_t  zone,
void *  unused 
)
static

◆ zone_update_caches()

static void zone_update_caches ( uma_zone_t  zone)
static

Definition at line 2785 of file uma_core.c.

References cache_set_uz_flags(), cache_set_uz_size(), uma_zone::uz_cpu, uma_zone::uz_flags, and uma_zone::uz_size.

Referenced by uma_zone_reserve_kva(), uma_zone_set_max(), uma_zone_set_smr(), and zone_ctor().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ booted

◆ bucket_zones

struct uma_bucket_zone bucket_zones[]
Initial value:
= {
{ NULL, "2 Bucket", 2, 4096 },
{ NULL, "4 Bucket", 4, 3072 },
{ NULL, "8 Bucket", 8, 2048 },
{ NULL, "16 Bucket", 16, 1024 },
{ NULL, "32 Bucket", BUCKET_SIZE(32), 512 },
{ NULL, "64 Bucket", BUCKET_SIZE(64), 256 },
{ NULL, "128 Bucket", BUCKET_SIZE(128), 128 },
{ NULL, "256 Bucket", BUCKET_SIZE(256), 64 },
{ NULL, NULL, 0}
}
#define BUCKET_SIZE(n)
Definition: uma_core.c:252

Definition at line 257 of file uma_core.c.

Referenced by bucket_init(), bucket_select(), bucket_zone_drain(), and bucket_zone_lookup().

◆ bucketdisable

int bucketdisable = 1
static

Definition at line 163 of file uma_core.c.

Referenced by bucket_enable(), cache_alloc(), and cache_free().

◆ hashzone

uma_zone_t hashzone
static

Definition at line 152 of file uma_core.c.

Referenced by hash_alloc(), hash_free(), and uma_startup1().

◆ kegs

uma_zone_t kegs
static

Definition at line 119 of file uma_core.c.

Referenced by uma_kcreate(), uma_startup1(), and zone_dtor().

◆ multipage_slabs

int multipage_slabs = 1
static

Definition at line 384 of file uma_core.c.

Referenced by keg_layout().

◆ slabzones

uma_zone_t slabzones[2]
static

Definition at line 146 of file uma_core.c.

Referenced by slabzone(), uma_reclaim_domain(), and uma_startup1().

◆ uma_align_cache

int uma_align_cache = 64 - 1

Definition at line 155 of file uma_core.c.

Referenced by uma_kcreate(), and uma_set_align().

◆ uma_callout

struct callout uma_callout
static

Definition at line 210 of file uma_core.c.

Referenced by uma_startup3(), and uma_timeout().

◆ uma_reclaim_needed

volatile int uma_reclaim_needed
static

Definition at line 5248 of file uma_core.c.

Referenced by uma_reclaim_wakeup(), and uma_reclaim_worker().

◆ zone_warnings

int zone_warnings = 1
static

Definition at line 380 of file uma_core.c.

Referenced by zone_log_warning().

◆ zones

uma_zone_t zones
static