FreeBSD kernel kern code
subr_pcpu.c File Reference
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/pcpu.h>
#include <sys/proc.h>
#include <sys/smp.h>
#include <sys/sx.h>
#include <vm/uma.h>
#include <ddb/ddb.h>
Include dependency graph for subr_pcpu.c:

Go to the source code of this file.

Data Structures

struct  dpcpu_free
 

Functions

 __FBSDID ("$FreeBSD$")
 
static MALLOC_DEFINE (M_PCPU, "Per-cpu", "Per-cpu resource accouting.")
 
 DPCPU_DEFINE_STATIC (char, modspace[DPCPU_MODMIN] __aligned(__alignof(void *)))
 
static TAILQ_HEAD (dpcpu_free)
 
void dpcpu_init (void *dpcpu, int cpuid)
 
static void dpcpu_startup (void *dummy __unused)
 
 SYSINIT (dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_startup, NULL)
 
static void pcpu_zones_startup (void)
 
 SYSINIT (pcpu_zones, SI_SUB_COUNTER, SI_ORDER_FIRST, pcpu_zones_startup, NULL)
 
void * dpcpu_alloc (int size)
 
void dpcpu_free (void *s, int size)
 
void dpcpu_copy (void *s, int size)
 
void pcpu_destroy (struct pcpu *pcpu)
 
struct pcpu * pcpu_find (u_int cpuid)
 
int sysctl_dpcpu_quad (SYSCTL_HANDLER_ARGS)
 
int sysctl_dpcpu_long (SYSCTL_HANDLER_ARGS)
 
int sysctl_dpcpu_int (SYSCTL_HANDLER_ARGS)
 

Variables

uma_zone_t pcpu_zone_4
 
uma_zone_t pcpu_zone_8
 
uma_zone_t pcpu_zone_16
 
uma_zone_t pcpu_zone_32
 
uma_zone_t pcpu_zone_64
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ dpcpu_alloc()

void * dpcpu_alloc ( int  size)

Definition at line 165 of file subr_pcpu.c.

References dpcpu_free::df_len, dpcpu_free::df_start, and free().

Referenced by link_elf_link_preload(), link_elf_load_file(), and parse_dpcpu().

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

◆ dpcpu_copy()

void dpcpu_copy ( void *  s,
int  size 
)

Definition at line 250 of file subr_pcpu.c.

Referenced by link_elf_link_preload(), link_elf_load_file(), and parse_dpcpu().

Here is the caller graph for this function:

◆ DPCPU_DEFINE_STATIC()

DPCPU_DEFINE_STATIC ( char  ,
modspace   __aligned(__alignof(void *))[DPCPU_MODMIN] 
)

◆ dpcpu_free()

void dpcpu_free ( void *  s,
int  size 
)

Definition at line 196 of file subr_pcpu.c.

References dpcpu_free::df_len, dpcpu_free::df_start, free(), malloc(), and start.

Referenced by link_elf_unload_file().

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

◆ dpcpu_init()

void dpcpu_init ( void *  dpcpu,
int  cpuid 
)

Definition at line 102 of file subr_pcpu.c.

References pcpu_find().

Here is the call graph for this function:

◆ dpcpu_startup()

static void dpcpu_startup ( void *dummy  __unused)
static

Definition at line 121 of file subr_pcpu.c.

References dpcpu_free::df_len, dpcpu_free::df_start, and malloc().

Here is the call graph for this function:

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_PCPU  ,
"Per-cpu"  ,
"Per-cpu resource accouting."   
)
static

◆ pcpu_destroy()

void pcpu_destroy ( struct pcpu *  pcpu)

Definition at line 271 of file subr_pcpu.c.

◆ pcpu_find()

struct pcpu * pcpu_find ( u_int  cpuid)

◆ pcpu_zones_startup()

static void pcpu_zones_startup ( void  )
static

Definition at line 143 of file subr_pcpu.c.

References pcpu_zone_16, pcpu_zone_32, pcpu_zone_4, pcpu_zone_64, and pcpu_zone_8.

◆ sysctl_dpcpu_int()

int sysctl_dpcpu_int ( SYSCTL_HANDLER_ARGS  )

Definition at line 324 of file subr_pcpu.c.

References count.

◆ sysctl_dpcpu_long()

int sysctl_dpcpu_long ( SYSCTL_HANDLER_ARGS  )

Definition at line 307 of file subr_pcpu.c.

References count.

◆ sysctl_dpcpu_quad()

int sysctl_dpcpu_quad ( SYSCTL_HANDLER_ARGS  )

Definition at line 290 of file subr_pcpu.c.

References count.

◆ SYSINIT() [1/2]

SYSINIT ( dpcpu  ,
SI_SUB_KLD  ,
SI_ORDER_FIRST  ,
dpcpu_startup  ,
NULL   
)

◆ SYSINIT() [2/2]

SYSINIT ( pcpu_zones  ,
SI_SUB_COUNTER  ,
SI_ORDER_FIRST  ,
pcpu_zones_startup  ,
NULL   
)

◆ TAILQ_HEAD()

static TAILQ_HEAD ( dpcpu_free  )
static

Definition at line 76 of file subr_pcpu.c.

Variable Documentation

◆ pcpu_zone_16

uma_zone_t pcpu_zone_16

Definition at line 138 of file subr_pcpu.c.

Referenced by mount_fini(), mount_init(), and pcpu_zones_startup().

◆ pcpu_zone_32

uma_zone_t pcpu_zone_32

Definition at line 139 of file subr_pcpu.c.

Referenced by pcpu_zones_startup().

◆ pcpu_zone_4

uma_zone_t pcpu_zone_4

Definition at line 136 of file subr_pcpu.c.

Referenced by pcpu_zones_startup().

◆ pcpu_zone_64

uma_zone_t pcpu_zone_64

Definition at line 140 of file subr_pcpu.c.

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

◆ pcpu_zone_8

uma_zone_t pcpu_zone_8