MCPcopy Create free account
hub / github.com/F-Stack/f-stack / domainset_zero

Function domainset_zero

freebsd/kern/kern_cpuset.c:1559–1580  ·  view source on GitHub ↗

* Create the domainset for cpuset 0, 1 and cpuset 2. */

Source from the content-addressed store, hash-verified

1557 * Create the domainset for cpuset 0, 1 and cpuset 2.
1558 */
1559void
1560domainset_zero(void)
1561{
1562 struct domainset *dset, *tmp;
1563
1564 mtx_init(&cpuset_lock, "cpuset", NULL, MTX_SPIN | MTX_RECURSE);
1565
1566 dset = &domainset0;
1567 DOMAINSET_COPY(&all_domains, &dset->ds_mask);
1568 dset->ds_policy = DOMAINSET_POLICY_FIRSTTOUCH;
1569 dset->ds_prefer = -1;
1570 curthread->td_domain.dr_policy = _domainset_create(dset, NULL);
1571
1572 domainset_copy(dset, &domainset2);
1573 domainset2.ds_policy = DOMAINSET_POLICY_INTERLEAVE;
1574 kernel_object->domain.dr_policy = _domainset_create(&domainset2, NULL);
1575
1576 /* Remove empty domains from the global policies. */
1577 LIST_FOREACH_SAFE(dset, &cpuset_domains, ds_link, tmp)
1578 if (domainset_empty_vm(dset))
1579 LIST_REMOVE(dset, ds_link);
1580}
1581
1582/*
1583 * Creates system-wide cpusets and the cpuset for thread0 including three

Callers 1

vm_mem_initFunction · 0.85

Calls 4

mtx_initFunction · 0.85
_domainset_createFunction · 0.85
domainset_copyFunction · 0.85
domainset_empty_vmFunction · 0.85

Tested by

no test coverage detected