Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_cpuset.c
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | |||||
* | * | ||||
* A simple application should not concern itself with sets at all and | * A simple application should not concern itself with sets at all and | ||||
* rather apply masks to its own threads via CPU_WHICH_TID and a -1 id | * rather apply masks to its own threads via CPU_WHICH_TID and a -1 id | ||||
* meaning 'curthread'. It may query available cpus for that tid with a | * meaning 'curthread'. It may query available cpus for that tid with a | ||||
* getaffinity call using (CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1, ...). | * getaffinity call using (CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1, ...). | ||||
*/ | */ | ||||
LIST_HEAD(domainlist, domainset); | LIST_HEAD(domainlist, domainset); | ||||
struct domainset __read_mostly domainset_fixed[MAXMEMDOM]; | |||||
struct domainset __read_mostly domainset_prefer[MAXMEMDOM]; | struct domainset __read_mostly domainset_prefer[MAXMEMDOM]; | ||||
struct domainset __read_mostly domainset_roundrobin; | struct domainset __read_mostly domainset_roundrobin; | ||||
static uma_zone_t cpuset_zone; | static uma_zone_t cpuset_zone; | ||||
static uma_zone_t domainset_zone; | static uma_zone_t domainset_zone; | ||||
static struct mtx cpuset_lock; | static struct mtx cpuset_lock; | ||||
static struct setlist cpuset_ids; | static struct setlist cpuset_ids; | ||||
static struct domainlist cpuset_domains; | static struct domainlist cpuset_domains; | ||||
▲ Show 20 Lines • Show All 1,267 Lines • ▼ Show 20 Lines | domainset_init(void) | ||||
dset = &domainset_roundrobin; | dset = &domainset_roundrobin; | ||||
DOMAINSET_COPY(&all_domains, &dset->ds_mask); | DOMAINSET_COPY(&all_domains, &dset->ds_mask); | ||||
dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; | dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; | ||||
dset->ds_prefer = -1; | dset->ds_prefer = -1; | ||||
_domainset_create(dset, NULL); | _domainset_create(dset, NULL); | ||||
for (i = 0; i < vm_ndomains; i++) { | for (i = 0; i < vm_ndomains; i++) { | ||||
dset = &domainset_fixed[i]; | |||||
DOMAINSET_ZERO(&dset->ds_mask); | |||||
DOMAINSET_SET(i, &dset->ds_mask); | |||||
dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN; | |||||
_domainset_create(dset, NULL); | |||||
dset = &domainset_prefer[i]; | dset = &domainset_prefer[i]; | ||||
DOMAINSET_COPY(&all_domains, &dset->ds_mask); | DOMAINSET_COPY(&all_domains, &dset->ds_mask); | ||||
dset->ds_policy = DOMAINSET_POLICY_PREFER; | dset->ds_policy = DOMAINSET_POLICY_PREFER; | ||||
dset->ds_prefer = i; | dset->ds_prefer = i; | ||||
_domainset_create(dset, NULL); | _domainset_create(dset, NULL); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 883 Lines • Show Last 20 Lines |