FreeBSD kernel kern code
|
#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/malloc.h>
#include <sys/mutex.h>
#include <sys/pcpu.h>
#include <sys/sched.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
#include <machine/smp.h>
#include "opt_sched.h"
Go to the source code of this file.
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | sysctl_kern_smp_active (SYSCTL_HANDLER_ARGS) |
static | SYSCTL_NODE (_kern, OID_AUTO, smp, CTLFLAG_RD|CTLFLAG_CAPRD|CTLFLAG_MPSAFE, 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_PROC (_kern_smp, OID_AUTO, active, CTLFLAG_RD|CTLTYPE_INT|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_smp_active, "I", "Indicates system is running in SMP mode") | |
SYSCTL_INT (_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD, &smp_disabled, 0, "SMP has been disabled from the loader") | |
SYSCTL_INT (_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, "Number of CPUs online") | |
SYSCTL_INT (_kern_smp, OID_AUTO, threads_per_core, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_threads_per_core, 0, "Number of SMT threads online per core") | |
SYSCTL_INT (_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, "Number of physical cores online") | |
SYSCTL_INT (_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, "Topology override setting; 0 is default provided by hardware.") | |
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_rendezvous_barrier (void *dummy) |
void | smp_rendezvous_cpus_retry (cpuset_t map, void(*setup_func)(void *), void(*action_func)(void *), void(*teardown_func)(void *), void(*wait_func)(void *, int), struct smp_rendezvous_cpus_retry_arg *arg) |
void | smp_rendezvous_cpus_done (struct smp_rendezvous_cpus_retry_arg *arg) |
int | quiesce_cpus (cpuset_t map, const char *wmesg, int prio) |
int | quiesce_all_cpus (const char *wmesg, int prio) |
void | quiesce_all_critical (void) |
static void | cpus_fence_seq_cst_issue (void *arg __unused) |
void | cpus_fence_seq_cst (void) |
Variables | |
cpuset_t | all_cpus |
int | mp_ncpus |
int | mp_maxcpus = MAXCPU |
volatile int | smp_started |
u_int | mp_maxid |
int | smp_disabled = 0 |
int | smp_cpus = 1 |
int | smp_threads_per_core = 1 |
int | mp_ncores = -1 |
int | smp_topology = 0 |
__FBSDID | ( | "$FreeBSD$" | ) |
void cpus_fence_seq_cst | ( | void | ) |
Definition at line 1062 of file subr_smp.c.
References cpus_fence_seq_cst_issue(), smp_no_rendezvous_barrier(), and smp_rendezvous().
|
static |
Definition at line 1048 of file subr_smp.c.
Referenced by cpus_fence_seq_cst().
|
static |
int quiesce_all_cpus | ( | const char * | wmesg, |
int | prio | ||
) |
Definition at line 1011 of file subr_smp.c.
References all_cpus, and quiesce_cpus().
Referenced by sysctl_debug_ktr_entries(), and thread_reap_barrier().
void quiesce_all_critical | ( | void | ) |
Definition at line 1024 of file subr_smp.c.
int quiesce_cpus | ( | cpuset_t | map, |
const char * | wmesg, | ||
int | prio | ||
) |
Definition at line 967 of file subr_smp.c.
References free(), malloc(), mp_maxid, pcpu_find(), quiesce_cpus(), sched_bind(), and sched_unbind().
Referenced by quiesce_all_cpus(), and quiesce_cpus().
void smp_no_rendezvous_barrier | ( | void * | dummy | ) |
Definition at line 893 of file subr_smp.c.
References smp_started.
Referenced by _rm_wlock(), cpus_fence_seq_cst(), rms_wlock_switch(), and vfs_op_barrier_wait().
void smp_rendezvous | ( | void(*)(void *) | setup_func, |
void(*)(void *) | action_func, | ||
void(*)(void *) | teardown_func, | ||
void * | arg | ||
) |
Definition at line 865 of file subr_smp.c.
References all_cpus, and smp_rendezvous_cpus().
Referenced by cpus_fence_seq_cst().
void smp_rendezvous_cpus | ( | cpuset_t | map, |
void(*)(void *) | setup_func, | ||
void(*)(void *) | action_func, | ||
void(*)(void *) | teardown_func, | ||
void * | arg | ||
) |
Definition at line 844 of file subr_smp.c.
Referenced by _rm_wlock(), smp_rendezvous(), and smp_rendezvous_cpus_retry().
void smp_rendezvous_cpus_done | ( | struct smp_rendezvous_cpus_retry_arg * | arg | ) |
Definition at line 951 of file subr_smp.c.
Referenced by rms_action_func(), and vfs_op_action_func().
void smp_rendezvous_cpus_retry | ( | cpuset_t | map, |
void(*)(void *) | setup_func, | ||
void(*)(void *) | action_func, | ||
void(*)(void *) | teardown_func, | ||
void(*)(void *, int) | wait_func, | ||
struct smp_rendezvous_cpus_retry_arg * | arg | ||
) |
Definition at line 901 of file subr_smp.c.
References smp_rendezvous_cpus(), and smp_started.
Referenced by rms_wlock_switch(), and vfs_op_barrier_wait().
SYSCTL_INT | ( | _kern_smp | , |
OID_AUTO | , | ||
cores | , | ||
CTLFLAG_RD| | CTLFLAG_CAPRD, | ||
& | mp_ncores, | ||
0 | , | ||
"Number of physical cores online" | |||
) |
SYSCTL_INT | ( | _kern_smp | , |
OID_AUTO | , | ||
cpus | , | ||
CTLFLAG_RD| | CTLFLAG_CAPRD, | ||
& | smp_cpus, | ||
0 | , | ||
"Number of CPUs online" | |||
) |
SYSCTL_INT | ( | _kern_smp | , |
OID_AUTO | , | ||
disabled | , | ||
CTLFLAG_RDTUN| | CTLFLAG_CAPRD, | ||
& | smp_disabled, | ||
0 | , | ||
"SMP has been disabled from the loader" | |||
) |
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 | , | ||
maxid | , | ||
CTLFLAG_RD| | CTLFLAG_CAPRD, | ||
& | mp_maxid, | ||
0 | , | ||
"Max CPU ID." | |||
) |
SYSCTL_INT | ( | _kern_smp | , |
OID_AUTO | , | ||
threads_per_core | , | ||
CTLFLAG_RD| | CTLFLAG_CAPRD, | ||
& | smp_threads_per_core, | ||
0 | , | ||
"Number of SMT threads online per core" | |||
) |
SYSCTL_INT | ( | _kern_smp | , |
OID_AUTO | , | ||
topology | , | ||
CTLFLAG_RDTUN | , | ||
& | smp_topology, | ||
0 | , | ||
"Topology override setting; 0 is default provided by hardware." | |||
) |
|
static |
Definition at line 1079 of file subr_smp.c.
References smp_started.
|
static |
SYSCTL_PROC | ( | _kern_smp | , |
OID_AUTO | , | ||
active | , | ||
CTLFLAG_RD|CTLTYPE_INT| | CTLFLAG_MPSAFE, | ||
NULL | , | ||
0 | , | ||
sysctl_kern_smp_active | , | ||
"I" | , | ||
"Indicates system is running in SMP mode" | |||
) |
SYSINIT | ( | cpu_mp_setvariables | , |
SI_SUB_TUNABLES | , | ||
SI_ORDER_FIRST | , | ||
mp_setvariables_for_up | , | ||
NULL | |||
) |
cpuset_t all_cpus |
Definition at line 70 of file subr_smp.c.
Referenced by _rm_wlock(), cpuset_thread0(), kdb_trap(), mp_setvariables_for_up(), quiesce_all_cpus(), rm_init_flags(), rms_wlock_switch(), root_get_cpus(), smp_rendezvous(), vfs_op_barrier_wait(), and vpanic().
int mp_maxcpus = MAXCPU |
Definition at line 74 of file subr_smp.c.
u_int mp_maxid |
Definition at line 77 of file subr_smp.c.
Referenced by bd_flushall(), bd_init(), bufinit(), ktls_init(), malloc_uninit(), mp_setvariables_for_up(), pmc_cpu_max(), quiesce_cpus(), smr_create(), sysctl_kern_cp_times(), and sysctl_kern_malloc_stats().
int mp_ncores = -1 |
Definition at line 105 of file subr_smp.c.
Referenced by mp_setvariables_for_up().
int mp_ncpus |
Definition at line 72 of file subr_smp.c.
Referenced by bufinit(), cf_set_method(), configtimer(), freebsd_copyout_auxargs(), lock_delay_default_init(), mp_setvariables_for_up(), nchinit(), sysctl_kern_callout_stat(), taskqgroup_drain_all(), timercb(), and vmem_startup().
int smp_cpus = 1 |
Definition at line 97 of file subr_smp.c.
Referenced by umtxq_busy().
int smp_disabled = 0 |
Definition at line 93 of file subr_smp.c.
volatile int smp_started |
Definition at line 76 of file subr_smp.c.
Referenced by cf_set_method(), configtimer(), sched_add(), sched_clock(), smp_no_rendezvous_barrier(), smp_rendezvous_cpus_retry(), sysctl_kern_smp_active(), and timercb().
int smp_threads_per_core = 1 |
Definition at line 101 of file subr_smp.c.
int smp_topology = 0 |
Definition at line 109 of file subr_smp.c.