FreeBSD kernel kern code
kern_malloc.c File Reference
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include "opt_kdtrace.h"
#include "opt_vm.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/mutex.h>
#include <sys/vmmeter.h>
#include <sys/proc.h>
#include <sys/sbuf.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <vm/vm_param.h>
#include <vm/vm_kern.h>
#include <vm/vm_extern.h>
#include <vm/vm_map.h>
#include <vm/vm_page.h>
#include <vm/uma.h>
#include <vm/uma_int.h>
#include <vm/uma_dbg.h>
#include <ddb/ddb.h>
Include dependency graph for kern_malloc.c:

Go to the source code of this file.

Macros

#define REALLOC_FRACTION   1 /* new block if <= half the size */
 
#define KMEM_ZSHIFT   4
 
#define KMEM_ZBASE   16
 
#define KMEM_ZMASK   (KMEM_ZBASE - 1)
 
#define KMEM_ZMAX   PAGE_SIZE
 
#define KMEM_ZSIZE   (KMEM_ZMAX >> KMEM_ZSHIFT)
 
#define MALLOC_DEBUG_MAXZONES   1
 

Functions

 __FBSDID ("$BSDSUniX$")
 
 MALLOC_DEFINE (M_CACHE,"cache","Various Dynamically allocated caches")
 
 MALLOC_DEFINE (M_DEVBUF,"devbuf","device driver memory")
 
 MALLOC_DEFINE (M_TEMP,"temp","misc temporary data buffers")
 
 MALLOC_DEFINE (M_IP6OPT,"ip6opt","IPv6 options")
 
 MALLOC_DEFINE (M_IP6NDP,"ip6ndp","IPv6 Neighbor Discovery")
 
static void kmeminit (void *)
 
 SYSINIT (kmem, SI_SUB_KMEM, SI_ORDER_FIRST, kmeminit, NULL)
 
 SYSCTL_ULONG (_vm, OID_AUTO, kmem_size, CTLFLAG_RDTUN,&vm_kmem_size, 0,"Size of kernel memory")
 
 SYSCTL_ULONG (_vm, OID_AUTO, kmem_size_min, CTLFLAG_RDTUN,&vm_kmem_size_min, 0,"Minimum size of kernel memory")
 
 SYSCTL_ULONG (_vm, OID_AUTO, kmem_size_max, CTLFLAG_RDTUN,&vm_kmem_size_max, 0,"Maximum size of kernel memory")
 
 SYSCTL_UINT (_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN,&vm_kmem_size_scale, 0,"Scale factor for kernel memory size")
 
static int sysctl_kmem_map_size (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_vm, OID_AUTO, kmem_map_size, CTLFLAG_RD|CTLTYPE_ULONG|CTLFLAG_MPSAFE, NULL, 0, sysctl_kmem_map_size,"LU","Current kmem_map allocation size")
 
static int sysctl_kmem_map_free (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_vm, OID_AUTO, kmem_map_free, CTLFLAG_RD|CTLTYPE_ULONG|CTLFLAG_MPSAFE, NULL, 0, sysctl_kmem_map_free,"LU","Largest contiguous free range in kmem_map")
 
static int sysctl_kern_malloc_stats (SYSCTL_HANDLER_ARGS)
 
static u_int mtp_get_subzone (const char *desc)
 
int malloc_last_fail (void)
 
static void malloc_type_zone_allocated (struct malloc_type *mtp, unsigned long size, int zindx)
 
void malloc_type_allocated (struct malloc_type *mtp, unsigned long size)
 
void malloc_type_freed (struct malloc_type *mtp, unsigned long size)
 
void * contigmalloc (unsigned long size, struct malloc_type *type, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, unsigned long boundary)
 
void contigfree (void *addr, unsigned long size, struct malloc_type *type)
 
void * malloc (unsigned long size, struct malloc_type *mtp, int flags)
 
void free (void *addr, struct malloc_type *mtp)
 
void * realloc (void *addr, unsigned long size, struct malloc_type *mtp, int flags)
 
void * reallocf (void *addr, unsigned long size, struct malloc_type *mtp, int flags)
 
void malloc_init (void *data)
 
void malloc_uninit (void *data)
 
struct malloc_type * malloc_desc2type (const char *desc)
 
 SYSCTL_PROC (_kern, OID_AUTO, malloc_stats, CTLFLAG_RD|CTLTYPE_STRUCT, 0, 0, sysctl_kern_malloc_stats,"s,malloc_type_ustats","Return malloc types")
 
 SYSCTL_INT (_kern, OID_AUTO, malloc_count, CTLFLAG_RD,&kmemcount, 0,"Count of kernel malloc types")
 
void malloc_type_list (malloc_type_list_func_t *func, void *arg)
 

Variables

static struct malloc_type * kmemstatistics
 
static vm_offset_t kmembase
 
static vm_offset_t kmemlimit
 
static int kmemcount
 
static uint8_t kmemsize [KMEM_ZSIZE+1]
 
static int numzones = MALLOC_DEBUG_MAXZONES
 
struct {
   int   kz_size
 
   char *   kz_name
 
   uma_zone_t   kz_zone [MALLOC_DEBUG_MAXZONES]
 
kmemzones []
 
static uma_zone_t mt_zone
 
u_long vm_kmem_size
 
static u_long vm_kmem_size_min
 
static u_long vm_kmem_size_max
 
static u_int vm_kmem_size_scale
 
struct mtx malloc_mtx
 
static time_t t_malloc_fail
 

Macro Definition Documentation

#define KMEM_ZBASE   16

Definition at line 125 of file kern_malloc.c.

Referenced by kmeminit(), and malloc().

#define KMEM_ZMASK   (KMEM_ZBASE - 1)

Definition at line 126 of file kern_malloc.c.

Referenced by malloc().

#define KMEM_ZMAX   PAGE_SIZE

Definition at line 128 of file kern_malloc.c.

Referenced by malloc().

#define KMEM_ZSHIFT   4

Definition at line 124 of file kern_malloc.c.

Referenced by kmeminit(), and malloc().

#define KMEM_ZSIZE   (KMEM_ZMAX >> KMEM_ZSHIFT)

Definition at line 129 of file kern_malloc.c.

#define MALLOC_DEBUG_MAXZONES   1

Definition at line 133 of file kern_malloc.c.

#define REALLOC_FRACTION   1 /* new block if <= half the size */

Definition at line 103 of file kern_malloc.c.

Referenced by realloc().

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
void contigfree ( void *  addr,
unsigned long  size,
struct malloc_type *  type 
)

Definition at line 438 of file kern_malloc.c.

References malloc_type_freed().

Here is the call graph for this function:

void* contigmalloc ( unsigned long  size,
struct malloc_type *  type,
int  flags,
vm_paddr_t  low,
vm_paddr_t  high,
unsigned long  alignment,
unsigned long  boundary 
)

Definition at line 417 of file kern_malloc.c.

References malloc_type_allocated().

Here is the call graph for this function:

void free ( void *  addr,
struct malloc_type *  mtp 
)

Definition at line 554 of file kern_malloc.c.

References malloc_type_freed(), and panic().

Referenced by __mnt_vnode_first(), __mnt_vnode_first_all(), __mnt_vnode_markerfree(), __mnt_vnode_markerfree_all(), _fdrop(), accept1(), acl_free(), allocbuf(), alq_destroy(), blist_destroy(), bsdsunix_fixup(), buf_ring_free(), busdma_bufalloc_destroy(), cf_get_method(), cf_levels_method(), cf_set_method(), clone_cleanup(), cluster_write_gb(), constty_clear(), copyiniov(), copyinuio(), coredump(), cpufreq_curr_sysctl(), cpufreq_detach(), cpufreq_dup_set(), cpufreq_settings_sysctl(), cpufreq_unregister(), crextend(), crfree(), dev_unlock_and_free(), devaddq(), devclass_add_device(), devclass_alloc_unit(), devclass_delete_device(), devclass_delete_driver(), devctl_queue_data_f(), device_free_softc(), device_set_desc_internal(), device_set_driver(), device_set_softc(), device_sysctl_handler(), devread(), devstat_alloc(), dirent_exists(), do_execve(), do_getopt_accept_filter(), do_osd_del(), do_sendfile(), do_setopt_accept_filter(), dpcpu_alloc(), dpcpu_free(), elf_set_delete(), eventhandler_deregister(), eventhandler_prune_list(), eventhandler_register_internal(), exec_free_args(), exec_register(), exec_unregister(), expand_name(), fddrop(), fdfree(), fdgrowtable(), fill_socket_info(), fill_vnode_info(), filt_timerdetach(), flushbufqueues(), free_mntarg(), freeenv(), fsetown(), funsetown(), funsetownlst(), get_proc_vector(), get_ps_strings(), getpeername1(), getsockaddr(), getsockname1(), graph_alloc_vertex(), graph_free_vertex(), graph_remove_edge(), hashdestroy(), hhook_add_hook(), hhook_add_hook_lookup(), hhook_head_destroy(), hhook_remove_hook(), huft_free(), inflate(), int_rman_release_resource(), intr_event_add_handler(), intr_event_destroy(), intr_event_remove_handler(), ithread_loop(), itimers_alloc(), itimers_event_hook_exit(), kdtrace_proc_dtor(), kdtrace_thread_dtor(), kern___getcwd(), kern_accept(), kern_alternate_path(), kern_getpeername(), kern_getsockname(), kern_jail(), kern_jail_set(), kern_posix_fadvise(), kern_proc_filedesc_out(), kern_proc_vmmap_out(), kern_ptrace(), kern_recvit(), kern_select(), kern_semctl(), kern_sendfile(), kern_shmat(), kobj_class_compile(), kobj_class_free(), kobj_delete(), kqueue_close(), kqueue_expand(), ksem_create(), ksem_drop(), ksem_remove(), lf_advlockasync(), lf_free_edge(), lf_free_lock(), lf_iteratelocks_sysid(), lf_iteratelocks_vnode(), lf_purgelocks(), lim_free(), link_elf_ctf_get(), link_elf_load_file(), link_elf_lookup_set(), link_elf_unload_file(), linker_file_unload(), linker_find_file_by_name(), linker_hints_lookup(), linker_load_module(), linker_lookup_file(), load_file(), log_console(), loginclass_find(), loginclass_free(), m_tag_free_default(), make_dev_physpath_alias(), malloc_type_list(), mbp_destroy(), mi_startup(), mnt_vnode_markerfree_active(), module_release(), mqueue_free(), mqueue_freemsg(), mqueue_loadmsg(), msgunload(), mtx_pool_destroy(), note_fpregset(), note_prpsinfo(), note_prstatus(), note_threadmd(), notify(), osd_register(), pargs_free(), parse_dir_md(), parse_dir_onfail(), parse_dir_timeout(), parse_directive(), parse_mount(), parse_mountroot_options(), pgdelete(), prison_deref(), prison_racct_free_locked(), proc_getauxv(), pstats_free(), ptrace_vm_entry(), ptsdrv_free(), realloc(), reallocf(), resource_list_delete(), resource_list_free(), resource_list_purge(), rman_adjust_resource(), rman_fini(), rman_manage_region(), rman_reserve_resource_bound(), root_mount_rel(), seltdfini(), semunload(), sendit(), sess_release(), set_rootvnode(), setenv(), sglist_free(), shm_drop(), shm_remove(), shmexit_myhook(), shmrealloc(), shmunload(), sigacts_free(), SLIST_HEAD(), stack_destroy(), sys_bind(), sys_connect(), sys_getgroups(), sys_ioctl(), sys_jail_get(), sys_jail_set(), sys_kenv(), sys_kldfind(), sys_kldload(), sys_kldsym(), sys_ksem_unlink(), sys_lio_listio(), sys_mount(), sys_nmount(), sys_olio_listio(), sys_poll(), sys_preadv(), sys_pwritev(), sys_readv(), sys_recvmsg(), sys_sctp_generic_recvmsg(), sys_sctp_generic_sendmsg(), sys_sctp_generic_sendmsg_iov(), sys_semop(), sys_sendmsg(), sys_setgroups(), sys_setpgid(), sys_setsid(), sys_shm_open(), sys_shm_unlink(), sys_unmount(), sys_utrace(), sys_uuidgen(), sys_writev(), sysctl_ctx_entry_del(), sysctl_ctx_free(), sysctl_debug_witness_badstacks(), sysctl_devctl_disable(), sysctl_devctl_queue(), sysctl_handle_string(), sysctl_jail_list(), sysctl_kern_proc_pathname(), sysctl_kern_ttys(), sysctl_remove_oid_locked(), sysctl_rename_oid(), sysctl_sysctl_name2oid(), sysinit_add(), taskqueue_free(), tty_alloc_mutex(), tty_dealloc(), uifind(), uifree(), uipc_bind(), uipc_detach(), umtxq_free(), unp_connect(), unp_gc(), unp_pcblist(), unp_process_defers(), unsetenv(), vfs_domount(), vfs_donmount(), vfs_export(), vfs_free_addrlist(), vfs_free_netcred(), vfs_freeopt(), vfs_freeopts(), vfs_hang_addrlist(), vfs_mountroot_conf0(), vfs_notify_upper(), vfs_read_dirent(), vfs_setpublicfs(), vn_fullpath(), vn_fullpath_global(), vn_io_fault(), vn_path_to_global_path(), vop_stdallocate(), and vop_stdvptocnp().

Here is the call graph for this function:

static void kmeminit ( void *  dummy)
static
void* malloc ( unsigned long  size,
struct malloc_type *  mtp,
int  flags 
)

Definition at line 454 of file kern_malloc.c.

References kdb_backtrace(), KMEM_ZBASE, KMEM_ZMASK, KMEM_ZMAX, KMEM_ZSHIFT, kmemsize, kmemzones, malloc_type_allocated(), malloc_type_zone_allocated(), numzones, ppsratecheck(), printf(), t_malloc_fail, and time_uptime.

Referenced by __mnt_vnode_first(), __mnt_vnode_first_active(), __mnt_vnode_first_all(), _taskqueue_create(), accept_filt_generic_mod_event(), acl_alloc(), allocbuf(), alq_open_flags(), blist_create(), buf_ring_alloc(), busdma_bufalloc_create(), cf_get_method(), cf_levels_method(), cf_set_method(), clone_setup(), cloneuio(), cluster_collectbufs(), constty_set(), copyiniov(), copyinuio(), coredump(), cpufreq_attach(), cpufreq_dup_set(), cpufreq_insert_abs(), cpufreq_settings_sysctl(), crextend(), crget(), devaddq(), devclass_add_device(), devclass_add_driver(), devclass_alloc_unit(), devclass_find_internal(), devclass_get_devices(), devclass_get_drivers(), devctl_notify_f(), devctl_queue_data_f(), device_get_children(), device_set_desc_internal(), device_set_driver(), device_sysctl_handler(), devstat_alloc(), dirent_exists(), do_getopt_accept_filter(), do_setopt_accept_filter(), dpcpu_free(), dpcpu_startup(), elf_set_add(), eventhandler_register(), eventhandler_register_internal(), exec_register(), exec_unregister(), expand_name(), fdgrowtable(), fdinit(), filedesc_to_leader_alloc(), filt_timerattach(), firmware_mountroot(), flushbufqueues(), fsetown(), get_proc_vector(), getenv(), getsockaddr(), graph_add_edge(), graph_alloc_vertex(), graph_init(), hashinit_flags(), hhook_add_hook(), hhook_add_hook_lookup(), hhook_head_register(), huft_build(), inflate(), init_dynamic_kenv(), init_hwpmc(), int_alloc_resource(), intr_event_add_handler(), intr_event_create(), ithread_create(), itimers_alloc(), kdtrace_proc_ctor(), kdtrace_thread_ctor(), kern___getcwd(), kern_alternate_path(), kern_getfsstat(), kern_jail(), kern_jail_set(), kern_posix_fadvise(), kern_proc_filedesc_out(), kern_proc_vmmap_out(), kern_ptrace(), kern_select(), kern_semctl(), kern_sendfile(), kern_shmat(), kobj_class_compile(), kobj_create(), kqueue_expand(), ksem_alloc(), ksem_create(), ksem_insert(), lf_advlockasync(), lf_alloc_edge(), lf_alloc_lock(), lf_iteratelocks_sysid(), lf_iteratelocks_vnode(), lim_alloc(), link_elf_ctf_get(), link_elf_link_common_finish(), link_elf_link_preload(), link_elf_load_file(), link_elf_lookup_set(), linker_file_lookup_symbol_internal(), linker_find_file_by_name(), linker_hints_lookup(), linker_lookup_file(), linker_strdup(), load_file(), log_console(), loginclass_find(), m_tag_alloc(), make_dev_physpath_alias(), make_device(), malloc_type_list(), mbp_create(), modlist_newmodule(), module_register(), mount_arg(), mount_argf(), mount_argsu(), mqueue_loadmsg(), msginit(), mtx_pool_create(), note_fpregset(), note_prpsinfo(), note_prstatus(), note_threadmd(), notify(), osd_register(), osd_set(), pargs_alloc(), parse_dir_md(), parse_mount(), parse_token(), phashinit(), prep_cdevsw(), prison_racct_find_locked(), pstats_alloc(), pts_alloc(), pts_alloc_external(), realloc(), register_note(), resource_list_add(), rman_init(), rman_reserve_resource_bound(), root_mount_hold(), seltdinit(), seminit(), setenv(), sglist_alloc(), shm_alloc(), shm_insert(), shmfork_myhook(), shminit(), shmrealloc(), sigacts_alloc(), sodupsockaddr(), stack_create(), start_softclock(), sys_getgroups(), sys_ioctl(), sys_kenv(), sys_kldfind(), sys_kldload(), sys_kldsym(), sys_kqueue(), sys_ksem_unlink(), sys_lio_listio(), sys_mount(), sys_olio_listio(), sys_poll(), sys_semop(), sys_setgroups(), sys_setpgid(), sys_setsid(), sys_shm_open(), sys_shm_unlink(), sys_unmount(), sys_utrace(), sys_uuidgen(), sysctl_add_oid(), sysctl_ctx_entry_add(), sysctl_debug_witness_badstacks(), sysctl_handle_string(), sysctl_jail_list(), sysctl_kern_ttys(), sysctl_sysctl_name2oid(), sysinit_add(), taskqueue_start_threads(), termcn_cnregister(), terminal_alloc(), tty_alloc_mutex(), uifind(), uipc_accept(), uipc_bind(), uipc_peeraddr(), uipc_sockaddr(), umtxq_alloc(), unp_connect(), unp_discard(), unp_gc(), unp_pcblist(), vfs_buildopts(), vfs_domount(), vfs_export(), vfs_hang_addrlist(), vfs_mergeopts(), vfs_mountroot_devfs(), vfs_notify_upper(), vfs_setpublicfs(), vn_fullpath(), vn_fullpath_global(), vop_stdallocate(), vop_stdvptocnp(), and witness_initialize().

Here is the call graph for this function:

MALLOC_DEFINE ( M_CACHE  ,
"cache"  ,
"Various Dynamically allocated caches"   
)
MALLOC_DEFINE ( M_DEVBUF  ,
"devbuf"  ,
"device driver memory"   
)
MALLOC_DEFINE ( M_TEMP  ,
"temp"  ,
"misc temporary data buffers"   
)
MALLOC_DEFINE ( M_IP6OPT  ,
"ip6opt"  ,
"IPv6 options"   
)
MALLOC_DEFINE ( M_IP6NDP  ,
"ip6ndp"  ,
"IPv6 Neighbor Discovery"   
)
struct malloc_type* malloc_desc2type ( const char *  desc)

Definition at line 870 of file kern_malloc.c.

References kmemstatistics, and malloc_mtx.

void malloc_init ( void *  data)

Definition at line 793 of file kern_malloc.c.

References kmemcount, kmemstatistics, malloc_mtx, mt_zone, mtp_get_subzone(), and panic().

Here is the call graph for this function:

int malloc_last_fail ( void  )

Definition at line 327 of file kern_malloc.c.

References t_malloc_fail, and time_uptime.

void malloc_type_allocated ( struct malloc_type *  mtp,
unsigned long  size 
)

Definition at line 370 of file kern_malloc.c.

References malloc_type_zone_allocated().

Referenced by contigmalloc(), and malloc().

Here is the call graph for this function:

Here is the caller graph for this function:

void malloc_type_freed ( struct malloc_type *  mtp,
unsigned long  size 
)

Definition at line 384 of file kern_malloc.c.

References critical_enter(), and critical_exit().

Referenced by contigfree(), and free().

Here is the call graph for this function:

Here is the caller graph for this function:

void malloc_type_list ( malloc_type_list_func_t *  func,
void *  arg 
)

Definition at line 942 of file kern_malloc.c.

References count, free(), kmemcount, kmemstatistics, malloc(), and malloc_mtx.

Here is the call graph for this function:

static void malloc_type_zone_allocated ( struct malloc_type *  mtp,
unsigned long  size,
int  zindx 
)
static

Definition at line 340 of file kern_malloc.c.

References critical_enter(), and critical_exit().

Referenced by malloc(), and malloc_type_allocated().

Here is the call graph for this function:

Here is the caller graph for this function:

void malloc_uninit ( void *  data)

Definition at line 816 of file kern_malloc.c.

References kmemcount, kmemstatistics, malloc_mtx, mt_zone, and printf().

Here is the call graph for this function:

static u_int mtp_get_subzone ( const char *  desc)
inlinestatic

Definition at line 319 of file kern_malloc.c.

Referenced by malloc_init().

Here is the caller graph for this function:

void* realloc ( void *  addr,
unsigned long  size,
struct malloc_type *  mtp,
int  flags 
)

Definition at line 616 of file kern_malloc.c.

References free(), malloc(), and REALLOC_FRACTION.

Referenced by do_osd_del(), graph_alloc_vertex(), linker_file_add_dependency(), mount_arg(), mount_argf(), osd_deregister(), osd_register(), osd_set(), reallocf(), sysctl_jail_list(), and vfs_read_dirent().

Here is the call graph for this function:

Here is the caller graph for this function:

void* reallocf ( void *  addr,
unsigned long  size,
struct malloc_type *  mtp,
int  flags 
)

Definition at line 675 of file kern_malloc.c.

References free(), and realloc().

Here is the call graph for this function:

SYSCTL_INT ( _kern  ,
OID_AUTO  ,
malloc_count  ,
CTLFLAG_RD  ,
kmemcount,
,
"Count of kernel malloc types"   
)
static int sysctl_kern_malloc_stats ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 883 of file kern_malloc.c.

References kmemcount, kmemstatistics, malloc_mtx, sbuf_bcat(), sbuf_delete(), sbuf_finish(), sbuf_new_for_sysctl(), and sysctl_wire_old_buffer().

Here is the call graph for this function:

static int sysctl_kmem_map_free ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 261 of file kern_malloc.c.

References sysctl_handle_long().

Here is the call graph for this function:

static int sysctl_kmem_map_size ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 252 of file kern_malloc.c.

References sysctl_handle_long().

Here is the call graph for this function:

SYSCTL_PROC ( _vm  ,
OID_AUTO  ,
kmem_map_size  ,
CTLFLAG_RD|CTLTYPE_ULONG|  CTLFLAG_MPSAFE,
NULL  ,
,
sysctl_kmem_map_size  ,
"LU"  ,
"Current kmem_map allocation size"   
)
SYSCTL_PROC ( _vm  ,
OID_AUTO  ,
kmem_map_free  ,
CTLFLAG_RD|CTLTYPE_ULONG|  CTLFLAG_MPSAFE,
NULL  ,
,
sysctl_kmem_map_free  ,
"LU"  ,
"Largest contiguous free range in kmem_map"   
)
SYSCTL_PROC ( _kern  ,
OID_AUTO  ,
malloc_stats  ,
CTLFLAG_RD|  CTLTYPE_STRUCT,
,
,
sysctl_kern_malloc_stats  ,
s,
malloc_type_ustats"  ,
"Return malloc types"   
)
SYSCTL_UINT ( _vm  ,
OID_AUTO  ,
kmem_size_scale  ,
CTLFLAG_RDTUN  ,
vm_kmem_size_scale,
,
"Scale factor for kernel memory size"   
)
SYSCTL_ULONG ( _vm  ,
OID_AUTO  ,
kmem_size  ,
CTLFLAG_RDTUN  ,
vm_kmem_size,
,
"Size of kernel memory"   
)
SYSCTL_ULONG ( _vm  ,
OID_AUTO  ,
kmem_size_min  ,
CTLFLAG_RDTUN  ,
vm_kmem_size_min,
,
"Minimum size of kernel memory"   
)
SYSCTL_ULONG ( _vm  ,
OID_AUTO  ,
kmem_size_max  ,
CTLFLAG_RDTUN  ,
vm_kmem_size_max,
,
"Maximum size of kernel memory"   
)
SYSINIT ( kmem  ,
SI_SUB_KMEM  ,
SI_ORDER_FIRST  ,
kmeminit  ,
NULL   
)

Variable Documentation

vm_offset_t kmembase
static

Definition at line 120 of file kern_malloc.c.

Referenced by kmeminit().

int kmemcount
static
vm_offset_t kmemlimit
static

Definition at line 121 of file kern_malloc.c.

Referenced by kmeminit().

uint8_t kmemsize[KMEM_ZSIZE+1]
static

Definition at line 130 of file kern_malloc.c.

Referenced by kmeminit(), and malloc().

struct malloc_type* kmemstatistics
static
struct { ... } kmemzones[]
Initial value:
= {
{16, "16", },
{32, "32", },
{64, "64", },
{128, "128", },
{256, "256", },
{512, "512", },
{1024, "1024", },
{2048, "2048", },
{4096, "4096", },
{0, NULL},
}

Referenced by kmeminit(), and malloc().

char* kz_name

Definition at line 147 of file kern_malloc.c.

int kz_size

Definition at line 146 of file kern_malloc.c.

uma_zone_t kz_zone[MALLOC_DEBUG_MAXZONES]

Definition at line 148 of file kern_malloc.c.

struct mtx malloc_mtx
uma_zone_t mt_zone
static

Definition at line 185 of file kern_malloc.c.

Referenced by kmeminit(), malloc_init(), and malloc_uninit().

int numzones = MALLOC_DEBUG_MAXZONES
static

Definition at line 135 of file kern_malloc.c.

Referenced by kmeminit(), and malloc().

time_t t_malloc_fail
static

Definition at line 229 of file kern_malloc.c.

Referenced by malloc(), and malloc_last_fail().

u_long vm_kmem_size

Definition at line 187 of file kern_malloc.c.

Referenced by kmeminit(), and vntblinit().

u_long vm_kmem_size_max
static

Definition at line 195 of file kern_malloc.c.

Referenced by kmeminit().

u_long vm_kmem_size_min
static

Definition at line 191 of file kern_malloc.c.

Referenced by kmeminit().

u_int vm_kmem_size_scale
static

Definition at line 199 of file kern_malloc.c.

Referenced by kmeminit().