|
FreeBSD kernel kern code
|
#include <sys/cdefs.h>#include "opt_ddb.h"#include <sys/param.h>#include <sys/systm.h>#include <sys/sysproto.h>#include <sys/jail.h>#include <sys/kernel.h>#include <sys/lock.h>#include <sys/malloc.h>#include <sys/mutex.h>#include <sys/priv.h>#include <sys/proc.h>#include <sys/refcount.h>#include <sys/sched.h>#include <sys/smp.h>#include <sys/syscallsubr.h>#include <sys/cpuset.h>#include <sys/sx.h>#include <sys/queue.h>#include <sys/libkern.h>#include <sys/limits.h>#include <sys/bus.h>#include <sys/interrupt.h>#include <vm/uma.h>
Go to the source code of this file.
Data Structures | |
| struct | cpuset_args |
| struct | cpuset_setid_args |
Functions | |
| __FBSDID ("$BSDSUniX$") | |
| SYSCTL_INT (_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, sizeof(cpuset_t),"sizeof(cpuset_t)") | |
| struct cpuset * | cpuset_ref (struct cpuset *set) |
| static struct cpuset * | cpuset_refroot (struct cpuset *set) |
| static struct cpuset * | cpuset_refbase (struct cpuset *set) |
| void | cpuset_rel (struct cpuset *set) |
| static void | cpuset_rel_defer (struct setlist *head, struct cpuset *set) |
| static void | cpuset_rel_complete (struct cpuset *set) |
| static struct cpuset * | cpuset_lookup (cpusetid_t setid, struct thread *td) |
| static int | _cpuset_create (struct cpuset *set, struct cpuset *parent, const cpuset_t *mask, cpusetid_t id) |
| static int | cpuset_create (struct cpuset **setp, struct cpuset *parent, const cpuset_t *mask) |
| static int | cpuset_testupdate (struct cpuset *set, cpuset_t *mask, int check_mask) |
| static void | cpuset_update (struct cpuset *set, cpuset_t *mask) |
| static int | cpuset_modify (struct cpuset *set, cpuset_t *mask) |
| static int | cpuset_which (cpuwhich_t which, id_t id, struct proc **pp, struct thread **tdp, struct cpuset **setp) |
| static int | cpuset_shadow (struct cpuset *set, struct cpuset *fset, const cpuset_t *mask) |
| static int | cpuset_setproc (pid_t pid, struct cpuset *set, cpuset_t *mask) |
| int | cpusetobj_ffs (const cpuset_t *set) |
| char * | cpusetobj_strprint (char *buf, const cpuset_t *set) |
| int | cpusetobj_strscan (cpuset_t *set, const char *buf) |
| int | cpuset_setthread (lwpid_t id, cpuset_t *mask) |
| struct cpuset * | cpuset_thread0 (void) |
| int | cpuset_create_root (struct prison *pr, struct cpuset **setp) |
| int | cpuset_setproc_update_set (struct proc *p, struct cpuset *set) |
| static void | cpuset_init (void *arg) |
| SYSINIT (cpuset, SI_SUB_SMP, SI_ORDER_ANY, cpuset_init, NULL) | |
| int | sys_cpuset (struct thread *td, struct cpuset_args *uap) |
| int | sys_cpuset_setid (struct thread *td, struct cpuset_setid_args *uap) |
Variables | |
| static uma_zone_t | cpuset_zone |
| static struct mtx | cpuset_lock |
| static struct setlist | cpuset_ids |
| static struct unrhdr * | cpuset_unr |
| static struct cpuset * | cpuset_zero |
| cpuset_t * | cpuset_root |
| __FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
Definition at line 253 of file kern_cpuset.c.
References cpuset_ids, cpuset_lock, and cpuset_ref().
Referenced by cpuset_create(), cpuset_setproc(), cpuset_shadow(), and cpuset_thread0().


|
static |
Definition at line 281 of file kern_cpuset.c.
References _cpuset_create(), alloc_unr(), cpuset_zone, free_unr(), and set.
Referenced by cpuset_create_root(), and sys_cpuset().


| int cpuset_create_root | ( | struct prison * | pr, |
| struct cpuset ** | setp | ||
| ) |
Definition at line 794 of file kern_cpuset.c.
References cpuset_create(), and set.
Referenced by kern_jail_set().


|
static |
Definition at line 837 of file kern_cpuset.c.
References all_cpus, cpuset_modify(), cpuset_zero, mask, and panic().

|
static |
Definition at line 216 of file kern_cpuset.c.
References cpuset_ids, cpuset_lock, cpuset_ref(), cpuset_rel(), jailed(), and set.
Referenced by cpuset_which(), and sys_cpuset_setid().


|
static |
Definition at line 351 of file kern_cpuset.c.
References cpuset_lock, cpuset_testupdate(), cpuset_update(), jailed(), and priv_check().
Referenced by cpuset_init().


| struct cpuset* cpuset_ref | ( | struct cpuset * | set | ) |
Definition at line 121 of file kern_cpuset.c.
Referenced by _cpuset_create(), cpuset_lookup(), cpuset_refbase(), cpuset_refroot(), cpuset_setproc(), cpuset_setproc_update_set(), cpuset_which(), proc0_init(), and sched_fork_thread().

|
static |
Definition at line 150 of file kern_cpuset.c.
References cpuset_ref().
Referenced by cpuset_which().


|
static |
Definition at line 133 of file kern_cpuset.c.
References cpuset_ref().
Referenced by sys_cpuset().


| void cpuset_rel | ( | struct cpuset * | set | ) |
Definition at line 164 of file kern_cpuset.c.
References cpuset_lock, cpuset_zone, and free_unr().
Referenced by cpuset_lookup(), cpuset_rel_complete(), cpuset_setproc_update_set(), cpuset_setthread(), prison_deref(), sys_cpuset(), sys_cpuset_setid(), thread_free(), and thread_wait().


|
static |
Definition at line 205 of file kern_cpuset.c.
References cpuset_rel(), and cpuset_zone.
Referenced by cpuset_setproc().


|
static |
Definition at line 187 of file kern_cpuset.c.
References cpuset_lock.
Referenced by cpuset_setproc().

|
static |
Definition at line 509 of file kern_cpuset.c.
References _cpuset_create(), cpuset_ref(), cpuset_rel_complete(), cpuset_rel_defer(), cpuset_shadow(), cpuset_which(), cpuset_zone, and sched_affinity().
Referenced by cpuset_setproc_update_set(), sys_cpuset(), and sys_cpuset_setid().


| int cpuset_setproc_update_set | ( | struct proc * | p, |
| struct cpuset * | set | ||
| ) |
Definition at line 817 of file kern_cpuset.c.
References cpuset_ref(), cpuset_rel(), and cpuset_setproc().
Referenced by do_jail_attach().


| int cpuset_setthread | ( | lwpid_t | id, |
| cpuset_t * | mask | ||
| ) |
Definition at line 707 of file kern_cpuset.c.
References cpuset_rel(), cpuset_shadow(), cpuset_which(), cpuset_zone, sched_affinity(), and set.
Referenced by intr_event_bind(), kproc_create(), and kthread_add().


|
static |
Definition at line 482 of file kern_cpuset.c.
References _cpuset_create(), parent, and set.
Referenced by cpuset_setproc(), and cpuset_setthread().


|
static |
Definition at line 306 of file kern_cpuset.c.
References cpuset_lock.
Referenced by cpuset_modify().

| struct cpuset* cpuset_thread0 | ( | void | ) |
Definition at line 750 of file kern_cpuset.c.
References _cpuset_create(), cpuset_ids, cpuset_lock, cpuset_zero, cpuset_zone, mtx_init(), new_unrhdr(), and set.
Referenced by proc0_init().


|
static |
Definition at line 333 of file kern_cpuset.c.
References cpuset_lock.
Referenced by cpuset_modify().

|
static |
Definition at line 399 of file kern_cpuset.c.
References allprison_lock, cpuset_lookup(), cpuset_ref(), cpuset_refbase(), p_cansched(), pfind(), pr, prison_find_child(), set, and tdfind().
Referenced by cpuset_setproc(), and cpuset_setthread().


| int cpusetobj_ffs | ( | const cpuset_t * | set | ) |
Definition at line 627 of file kern_cpuset.c.
| char* cpusetobj_strprint | ( | char * | buf, |
| const cpuset_t * | set | ||
| ) |
Definition at line 648 of file kern_cpuset.c.
References buf, and snprintf().
Referenced by sysctl_debug_ktr_cpumask().


| int cpusetobj_strscan | ( | cpuset_t * | set, |
| const char * | buf | ||
| ) |
Definition at line 671 of file kern_cpuset.c.
References sscanf().
Referenced by ktr_cpumask_initializer(), and sysctl_debug_ktr_cpumask().


| int sys_cpuset | ( | struct thread * | td, |
| struct cpuset_args * | uap | ||
| ) |
Definition at line 854 of file kern_cpuset.c.
References cpuset_create(), cpuset_refroot(), cpuset_rel(), cpuset_setproc(), set, and cpuset_args::setid.

| int sys_cpuset_setid | ( | struct thread * | td, |
| struct cpuset_setid_args * | uap | ||
| ) |
Definition at line 882 of file kern_cpuset.c.
References cpuset_lookup(), cpuset_rel(), cpuset_setproc(), cpuset_setid_args::id, set, cpuset_setid_args::setid, and cpuset_setid_args::which.

| SYSCTL_INT | ( | _kern_sched | , |
| OID_AUTO | , | ||
| cpusetsize | , | ||
| CTLFLAG_RD | , | ||
| SYSCTL_NULL_INT_PTR | , | ||
| sizeof(cpuset_t) | , | ||
| "sizeof(cpuset_t)" | |||
| ) |
| SYSINIT | ( | cpuset | , |
| SI_SUB_SMP | , | ||
| SI_ORDER_ANY | , | ||
| cpuset_init | , | ||
| NULL | |||
| ) |
|
static |
Definition at line 107 of file kern_cpuset.c.
Referenced by _cpuset_create(), cpuset_lookup(), and cpuset_thread0().
|
static |
Definition at line 106 of file kern_cpuset.c.
Referenced by _cpuset_create(), cpuset_lookup(), cpuset_modify(), cpuset_rel(), cpuset_rel_defer(), cpuset_testupdate(), cpuset_thread0(), and cpuset_update().
| cpuset_t* cpuset_root |
Definition at line 115 of file kern_cpuset.c.
Referenced by intr_event_bind(), intr_getaffinity(), intr_setaffinity(), kproc_create(), and kthread_add().
|
static |
Definition at line 108 of file kern_cpuset.c.
|
static |
Definition at line 109 of file kern_cpuset.c.
Referenced by cpuset_init(), and cpuset_thread0().
|
static |
Definition at line 105 of file kern_cpuset.c.
Referenced by cpuset_create(), cpuset_rel(), cpuset_rel_complete(), cpuset_setproc(), cpuset_setthread(), and cpuset_thread0().