FreeBSD kernel kern code
subr_smp.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/proc.h>
#include <sys/bus.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/pcpu.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
#include <machine/smp.h>
#include "opt_sched.h"
Include dependency graph for subr_smp.c:

Go to the source code of this file.

Functions

 __FBSDID ("$BSDSUniX$")
 
static SYSCTL_NODE (_kern, OID_AUTO, smp, CTLFLAG_RD|CTLFLAG_CAPRD, NULL,"Kernel SMP")
 
 SYSCTL_INT (_kern_smp, OID_AUTO, maxid, CTLFLAG_RD|CTLFLAG_CAPRD,&mp_maxid, 0,"Max CPU ID.")
 
 SYSCTL_INT (_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD,&mp_maxcpus, 0,"Max number of CPUs that the system was compiled for.")
 
 SYSCTL_INT (_kern_smp, OID_AUTO, active, CTLFLAG_RW,&smp_active, 0,"Number of Auxillary Processors (APs) that were successfully started")
 
 SYSCTL_INT (_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD,&smp_disabled, 0,"SMP has been disabled from the loader")
 
 TUNABLE_INT ("kern.smp.disabled",&smp_disabled)
 
 SYSCTL_INT (_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD,&smp_cpus, 0,"Number of CPUs online")
 
 SYSCTL_INT (_kern_smp, OID_AUTO, topology, CTLFLAG_RD,&smp_topology, 0,"Topology override setting; 0 is default provided by hardware.")
 
 TUNABLE_INT ("kern.smp.topology",&smp_topology)
 
void smp_rendezvous_cpus (cpuset_t map, void(*setup_func)(void *), void(*action_func)(void *), void(*teardown_func)(void *), void *arg)
 
void smp_rendezvous (void(*setup_func)(void *), void(*action_func)(void *), void(*teardown_func)(void *), void *arg)
 
static void mp_setvariables_for_up (void *dummy)
 
 SYSINIT (cpu_mp_setvariables, SI_SUB_TUNABLES, SI_ORDER_FIRST, mp_setvariables_for_up, NULL)
 
void smp_no_rendevous_barrier (void *dummy)
 

Variables

cpuset_t all_cpus
 
int mp_ncpus
 
int mp_maxcpus = MAXCPU
 
volatile int smp_started
 
u_int mp_maxid
 
int smp_active = 0
 
int smp_disabled = 0
 
int smp_cpus = 1
 
int smp_topology = 0
 

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
static void mp_setvariables_for_up ( void *  dummy)
static

Definition at line 707 of file subr_smp.c.

References all_cpus, mp_maxid, and mp_ncpus.

void smp_no_rendevous_barrier ( void *  dummy)

Definition at line 719 of file subr_smp.c.

References smp_started.

Referenced by _rm_wlock().

Here is the caller graph for this function:

void smp_rendezvous ( void(*)(void *)  setup_func,
void(*)(void *)  action_func,
void(*)(void *)  teardown_func,
void *  arg 
)

Definition at line 685 of file subr_smp.c.

void smp_rendezvous_cpus ( cpuset_t  map,
void(*)(void *)  setup_func,
void(*)(void *)  action_func,
void(*)(void *)  teardown_func,
void *  arg 
)

Definition at line 664 of file subr_smp.c.

Referenced by _rm_wlock().

Here is the caller graph for this function:

SYSCTL_INT ( _kern_smp  ,
OID_AUTO  ,
maxid  ,
CTLFLAG_RD|  CTLFLAG_CAPRD,
mp_maxid,
,
"Max CPU ID."   
)
SYSCTL_INT ( _kern_smp  ,
OID_AUTO  ,
maxcpus  ,
CTLFLAG_RD|  CTLFLAG_CAPRD,
mp_maxcpus,
,
"Max number of CPUs that the system was compiled for."   
)
SYSCTL_INT ( _kern_smp  ,
OID_AUTO  ,
active  ,
CTLFLAG_RW  ,
smp_active,
,
"Number of Auxillary Processors (APs) that were successfully started"   
)
SYSCTL_INT ( _kern_smp  ,
OID_AUTO  ,
disabled  ,
CTLFLAG_RDTUN|  CTLFLAG_CAPRD,
smp_disabled,
,
"SMP has been disabled from the loader"   
)
SYSCTL_INT ( _kern_smp  ,
OID_AUTO  ,
cpus  ,
CTLFLAG_RD|  CTLFLAG_CAPRD,
smp_cpus,
,
"Number of CPUs online"   
)
SYSCTL_INT ( _kern_smp  ,
OID_AUTO  ,
topology  ,
CTLFLAG_RD  ,
smp_topology,
,
"Topology override setting; 0 is default provided by hardware."   
)
static SYSCTL_NODE ( _kern  ,
OID_AUTO  ,
smp  ,
CTLFLAG_RD|  CTLFLAG_CAPRD,
NULL  ,
"Kernel SMP"   
)
static
SYSINIT ( cpu_mp_setvariables  ,
SI_SUB_TUNABLES  ,
SI_ORDER_FIRST  ,
mp_setvariables_for_up  ,
NULL   
)
TUNABLE_INT ( "kern.smp.disabled"  ,
smp_disabled 
)
TUNABLE_INT ( "kern.smp.topology"  ,
smp_topology 
)

Variable Documentation

cpuset_t all_cpus
int mp_maxcpus = MAXCPU

Definition at line 65 of file subr_smp.c.

u_int mp_maxid

Definition at line 68 of file subr_smp.c.

Referenced by mp_setvariables_for_up(), pmc_cpu_max(), and sysctl_kern_cp_times().

int smp_active = 0

Definition at line 79 of file subr_smp.c.

Referenced by cf_set_method().

int smp_cpus = 1

Definition at line 88 of file subr_smp.c.

Referenced by umtxq_busy().

int smp_disabled = 0

Definition at line 83 of file subr_smp.c.

volatile int smp_started

Definition at line 67 of file subr_smp.c.

Referenced by configtimer(), sched_add(), smp_no_rendevous_barrier(), and timercb().

int smp_topology = 0

Definition at line 92 of file subr_smp.c.