Lines Matching full:set
85 * Each process belongs to an identified set, by default this is set 1. Each
87 * named set. This creates an anonymous set which other threads and processes
90 * The named set is referred to herein as the 'base' set to avoid ambiguity.
91 * This set is usually a child of a 'root' set while the anonymous set may
95 * Threads inherit their set from their creator whether it be anonymous or
97 * shared. To modify an anonymous set a new set is created with the desired
98 * mask and the same parent as the existing anonymous set. This gives the
102 * or mask that is discovered via a pid, tid, or setid. Modifying a set
105 * exist within the assigned parent set.
156 * Find the first non-anonymous set starting from 'set'.
159 cpuset_getbase(struct cpuset *set) in cpuset_getbase() argument
162 if (set->cs_id == CPUSET_INVALID) in cpuset_getbase()
163 set = set->cs_parent; in cpuset_getbase()
164 return (set); in cpuset_getbase()
168 * Walks up the tree from 'set' to find the root.
171 cpuset_getroot(struct cpuset *set) in cpuset_getroot() argument
174 while ((set->cs_flags & CPU_SET_ROOT) == 0 && set->cs_parent != NULL) in cpuset_getroot()
175 set = set->cs_parent; in cpuset_getroot()
176 return (set); in cpuset_getroot()
183 cpuset_ref(struct cpuset *set) in cpuset_ref() argument
186 refcount_acquire(&set->cs_ref); in cpuset_ref()
187 return (set); in cpuset_ref()
191 * Walks up the tree from 'set' to find the root. Returns the root
195 cpuset_refroot(struct cpuset *set) in cpuset_refroot() argument
198 return (cpuset_ref(cpuset_getroot(set))); in cpuset_refroot()
202 * Find the first non-anonymous set starting from 'set'. Returns this set
203 * referenced. May return the passed in set with an extra ref if it is
207 cpuset_refbase(struct cpuset *set) in cpuset_refbase() argument
210 return (cpuset_ref(cpuset_getbase(set))); in cpuset_refbase()
217 cpuset_rel(struct cpuset *set) in cpuset_rel() argument
221 if (refcount_release_if_not_last(&set->cs_ref)) in cpuset_rel()
224 if (!refcount_release(&set->cs_ref)) { in cpuset_rel()
228 LIST_REMOVE(set, cs_siblings); in cpuset_rel()
229 id = set->cs_id; in cpuset_rel()
231 LIST_REMOVE(set, cs_link); in cpuset_rel()
233 cpuset_rel(set->cs_parent); in cpuset_rel()
234 uma_zfree(cpuset_zone, set); in cpuset_rel()
244 cpuset_rel_defer(struct setlist *head, struct cpuset *set) in cpuset_rel_defer() argument
247 if (refcount_release_if_not_last(&set->cs_ref)) in cpuset_rel_defer()
250 if (!refcount_release(&set->cs_ref)) { in cpuset_rel_defer()
254 LIST_REMOVE(set, cs_siblings); in cpuset_rel_defer()
255 if (set->cs_id != CPUSET_INVALID) in cpuset_rel_defer()
256 LIST_REMOVE(set, cs_link); in cpuset_rel_defer()
257 LIST_INSERT_HEAD(head, set, cs_link); in cpuset_rel_defer()
262 * Complete a deferred release. Removes the set from the list provided to
266 cpuset_rel_complete(struct cpuset *set) in cpuset_rel_complete() argument
270 id = set->cs_id; in cpuset_rel_complete()
271 LIST_REMOVE(set, cs_link); in cpuset_rel_complete()
272 cpuset_rel(set->cs_parent); in cpuset_rel_complete()
273 uma_zfree(cpuset_zone, set); in cpuset_rel_complete()
279 * Find a set based on an id. Returns it with a ref.
284 struct cpuset *set; in cpuset_lookup() local
289 LIST_FOREACH(set, &cpuset_ids, cs_link) in cpuset_lookup()
290 if (set->cs_id == setid) in cpuset_lookup()
292 if (set) in cpuset_lookup()
293 cpuset_ref(set); in cpuset_lookup()
297 if (set != NULL && jailed(td->td_ucred)) { in cpuset_lookup()
301 for (tset = set; tset != NULL; tset = tset->cs_parent) in cpuset_lookup()
305 cpuset_rel(set); in cpuset_lookup()
306 set = NULL; in cpuset_lookup()
310 return (set); in cpuset_lookup()
314 * Initialize a set in the space provided in 'set' with the provided parameters.
315 * The set is returned with a single ref. May return EDEADLK if the set
319 cpuset_init(struct cpuset *set, struct cpuset *parent, in cpuset_init() argument
332 CPU_COPY(mask, &set->cs_mask); in cpuset_init()
333 LIST_INIT(&set->cs_children); in cpuset_init()
334 refcount_init(&set->cs_ref, 1); in cpuset_init()
335 set->cs_flags = 0; in cpuset_init()
337 set->cs_domain = domain; in cpuset_init()
338 CPU_AND(&set->cs_mask, &set->cs_mask, &parent->cs_mask); in cpuset_init()
339 set->cs_id = id; in cpuset_init()
340 set->cs_parent = cpuset_ref(parent); in cpuset_init()
341 LIST_INSERT_HEAD(&parent->cs_children, set, cs_siblings); in cpuset_init()
342 if (set->cs_id != CPUSET_INVALID) in cpuset_init()
343 LIST_INSERT_HEAD(&cpuset_ids, set, cs_link); in cpuset_init()
350 * Create a new non-anonymous set with the requested parent and mask. May
361 struct cpuset *set; in cpuset_create() local
371 set = *setp; in cpuset_create()
373 *setp = set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); in cpuset_create()
374 error = cpuset_init(set, parent, mask, NULL, id); in cpuset_create()
379 uma_zfree(cpuset_zone, set); in cpuset_create()
387 struct cpuset *set; in cpuset_freelist_add() local
391 set = uma_zalloc(cpuset_zone, M_ZERO | M_WAITOK); in cpuset_freelist_add()
392 LIST_INSERT_HEAD(list, set, cs_link); in cpuset_freelist_add()
407 struct cpuset *set; in cpuset_freelist_free() local
409 while ((set = LIST_FIRST(list)) != NULL) { in cpuset_freelist_free()
410 LIST_REMOVE(set, cs_link); in cpuset_freelist_free()
411 uma_zfree(cpuset_zone, set); in cpuset_freelist_free()
418 struct domainset *set; in domainset_freelist_add() local
422 set = uma_zalloc(domainset_zone, M_ZERO | M_WAITOK); in domainset_freelist_add()
423 LIST_INSERT_HEAD(list, set, ds_link); in domainset_freelist_add()
438 struct domainset *set; in domainset_freelist_free() local
440 while ((set = LIST_FIRST(list)) != NULL) { in domainset_freelist_free()
441 LIST_REMOVE(set, ds_link); in domainset_freelist_free()
442 uma_zfree(domainset_zone, set); in domainset_freelist_free()
546 /* Remove empty domains from the set and recompute. */ in domainset_empty_vm()
617 * Create a new set that is a subset of a parent.
643 * the tree of sets starting at 'set'. Checks for sets that would become
647 cpuset_testupdate(struct cpuset *set, cpuset_t *mask, int augment_mask) in cpuset_testupdate() argument
654 if (set->cs_flags & CPU_SET_RDONLY) in cpuset_testupdate()
657 CPU_AND(&newmask, &set->cs_mask, mask); in cpuset_testupdate()
664 LIST_FOREACH(nset, &set->cs_children, cs_siblings) in cpuset_testupdate()
674 cpuset_update(struct cpuset *set, cpuset_t *mask) in cpuset_update() argument
679 CPU_AND(&set->cs_mask, &set->cs_mask, mask); in cpuset_update()
680 LIST_FOREACH(nset, &set->cs_children, cs_siblings) in cpuset_update()
681 cpuset_update(nset, &set->cs_mask); in cpuset_update()
687 * Modify the set 'set' to use a copy of the mask provided. Apply this new
692 cpuset_modify(struct cpuset *set, cpuset_t *mask) in cpuset_modify() argument
707 if ((set->cs_flags & CPU_SET_ROOT) != 0 && in cpuset_modify()
709 set == curthread->td_ucred->cr_prison->pr_cpuset) in cpuset_modify()
712 * Verify that we have access to this set of in cpuset_modify()
715 if ((set->cs_flags & (CPU_SET_ROOT | CPU_SET_RDONLY)) == CPU_SET_ROOT) { in cpuset_modify()
716 KASSERT(set->cs_parent != NULL, in cpuset_modify()
718 set->cs_id)); in cpuset_modify()
725 root = set->cs_parent; in cpuset_modify()
727 root = cpuset_getroot(set); in cpuset_modify()
734 error = cpuset_testupdate(set, mask, 0); in cpuset_modify()
737 CPU_COPY(mask, &set->cs_mask); in cpuset_modify()
738 cpuset_update(set, mask); in cpuset_modify()
747 * the tree of sets starting at 'set'. Checks for sets that would become
751 cpuset_testupdate_domain(struct cpuset *set, struct domainset *dset, in cpuset_testupdate_domain() argument
760 if (set->cs_flags & CPU_SET_RDONLY) in cpuset_testupdate_domain()
762 domain = set->cs_domain; in cpuset_testupdate_domain()
772 LIST_FOREACH(nset, &set->cs_children, cs_siblings) in cpuset_testupdate_domain()
783 cpuset_update_domain(struct cpuset *set, struct domainset *domain, in cpuset_update_domain() argument
791 * a new set. Otherwise it simply inherits from the parent. When in cpuset_update_domain()
793 * set is modified from the parent we keep the policy and only in cpuset_update_domain()
796 if (set->cs_domain != orig) { in cpuset_update_domain()
797 orig = set->cs_domain; in cpuset_update_domain()
798 set->cs_domain = domainset_shadow(domain, orig, domains); in cpuset_update_domain()
800 set->cs_domain = domain; in cpuset_update_domain()
801 LIST_FOREACH(nset, &set->cs_children, cs_siblings) in cpuset_update_domain()
802 cpuset_update_domain(nset, set->cs_domain, orig, domains); in cpuset_update_domain()
808 * Modify the set 'set' to use a copy the domainset provided. Apply this new
813 cpuset_modify_domain(struct cpuset *set, struct domainset *domain) in cpuset_modify_domain() argument
832 set->cs_flags & CPU_SET_ROOT) in cpuset_modify_domain()
840 root = cpuset_getroot(set); in cpuset_modify_domain()
843 * Verify that we have access to this set of domains. in cpuset_modify_domain()
850 * If applying prefer we keep the current set as the fallback. in cpuset_modify_domain()
853 DOMAINSET_COPY(&set->cs_domain->ds_mask, in cpuset_modify_domain()
856 * Determine whether we can apply this set of domains and in cpuset_modify_domain()
861 error = cpuset_testupdate_domain(set, &temp, set->cs_domain, in cpuset_modify_domain()
874 dset = set->cs_domain; in cpuset_modify_domain()
875 cpuset_update_domain(set, domain, dset, &domains); in cpuset_modify_domain()
891 * For WHICH_SET returns a valid set with a new reference.
894 * the base set of the current thread. May fail with ESRCH/EPERM.
900 struct cpuset *set; in cpuset_which() local
907 *setp = set = NULL; in cpuset_which()
949 set = cpuset_refbase(curthread->td_cpuset); in cpuset_which()
952 set = cpuset_lookup(id, curthread); in cpuset_which()
953 if (set) { in cpuset_which()
954 *setp = set; in cpuset_which()
960 /* Find `set' for prison with given id. */ in cpuset_which()
1006 cpuset_testshadow(struct cpuset *set, const cpuset_t *mask, in cpuset_testshadow() argument
1012 parent = cpuset_getbase(set); in cpuset_testshadow()
1032 * Create an anonymous set with the provided mask in the space provided by
1033 * 'nset'. If the passed in set is anonymous we use its parent otherwise
1034 * the new set is a child of 'set'.
1037 cpuset_shadow(struct cpuset *set, struct cpuset **nsetp, in cpuset_shadow() argument
1047 error = cpuset_testshadow(set, mask, domain); in cpuset_shadow()
1051 parent = cpuset_getbase(set); in cpuset_shadow()
1054 mask = &set->cs_mask; in cpuset_shadow()
1058 d = set->cs_domain; in cpuset_shadow()
1112 cpuset_setproc_setthread_mask(struct cpuset *tdset, struct cpuset *set, in cpuset_setproc_setthread_mask() argument
1121 * restriction to the new set, otherwise take it wholesale. in cpuset_setproc_setthread_mask()
1124 CPU_AND(mask, &tdset->cs_mask, &set->cs_mask); in cpuset_setproc_setthread_mask()
1126 CPU_COPY(&set->cs_mask, mask); in cpuset_setproc_setthread_mask()
1130 * restriction to the new set but retain the policy. in cpuset_setproc_setthread_mask()
1134 DOMAINSET_AND(&domain->ds_mask, &set->cs_domain->ds_mask); in cpuset_setproc_setthread_mask()
1136 domainset_copy(set->cs_domain, domain); in cpuset_setproc_setthread_mask()
1145 cpuset_setproc_test_setthread(struct cpuset *tdset, struct cpuset *set) in cpuset_setproc_test_setthread() argument
1152 return cpuset_setproc_setthread_mask(tdset, set, &mask, &domain); in cpuset_setproc_test_setthread()
1156 cpuset_setproc_setthread(struct cpuset *tdset, struct cpuset *set, in cpuset_setproc_setthread() argument
1166 * original set we can simply accept the new set. in cpuset_setproc_setthread()
1169 *nsetp = cpuset_ref(set); in cpuset_setproc_setthread()
1172 error = cpuset_setproc_setthread_mask(tdset, set, &mask, &domain); in cpuset_setproc_setthread()
1176 return cpuset_shadow(set, nsetp, &mask, &domain, freelist, in cpuset_setproc_setthread()
1181 cpuset_setproc_newbase(struct thread *td, struct cpuset *set, in cpuset_setproc_newbase() argument
1196 DOMAINSET_AND(&ndomain.ds_mask, &set->cs_domain->ds_mask); in cpuset_setproc_newbase()
1210 error = cpuset_create(&pbase, set, &nmask); in cpuset_setproc_newbase()
1217 pbase->cs_domain = domainset_shadow(set->cs_domain, &ndomain, in cpuset_setproc_newbase()
1226 * 1) Set is non-null and the process is not rebasing onto a new root. This
1227 * reparents all anonymous sets to the provided set and replaces all
1228 * non-anonymous td_cpusets with the provided set.
1229 * 2) Set is non-null and the process is rebasing onto a new root. This
1230 * creates a new base set if the process previously had its own base set,
1231 * then reparents all anonymous sets either to that set or the provided set
1236 * and replaces the domain set.
1243 cpuset_setproc(pid_t pid, struct cpuset *set, cpuset_t *mask, in cpuset_setproc() argument
1268 base = set; in cpuset_setproc()
1270 if (set != NULL) in cpuset_setproc()
1271 nroot = cpuset_getroot(set); in cpuset_setproc()
1278 if (set != NULL && rebase && tdroot != nroot) in cpuset_setproc()
1292 * If we're changing roots and the root set is what has been specified in cpuset_setproc()
1294 * the root set and, if it wasn't, create a new base with the process's in cpuset_setproc()
1302 if (set != NULL && rebase && nroot != tdroot) { in cpuset_setproc()
1309 error = cpuset_setproc_newbase(td, set, nroot, &base, in cpuset_setproc()
1327 if (set != NULL) in cpuset_setproc()
1344 if (set != NULL) in cpuset_setproc()
1360 if (base != NULL && base != set) in cpuset_setproc()
1370 bitset_strprint(char *buf, size_t bufsiz, const struct bitset *set, int setlen) in bitset_strprint() argument
1389 bytes = snprintf(p, bufsiz, "%lx", set->__bits[i]); in bitset_strprint()
1397 bitset_strscan(struct bitset *set, int setlen, const char *buf) in bitset_strscan() argument
1402 BIT_ZERO(setlen, set); in bitset_strscan()
1409 ret = sscanf(p, "%lx", &set->__bits[i]); in bitset_strscan()
1423 cpusetobj_strprint(char *buf, const cpuset_t *set) in cpusetobj_strprint() argument
1426 bitset_strprint(buf, CPUSETBUFSIZ, (const struct bitset *)set, in cpusetobj_strprint()
1436 cpusetobj_strscan(cpuset_t *set, const char *buf) in cpusetobj_strscan() argument
1443 p = buf[bitset_strscan((struct bitset *)set, CPU_SETSIZE, buf)]; in cpusetobj_strscan()
1511 struct cpuset *set; in _cpuset_setthread() local
1518 error = cpuset_which(CPU_WHICH_TID, id, &p, &td, &set); in _cpuset_setthread()
1521 set = NULL; in _cpuset_setthread()
1526 set = cpuset_update_thread(td, nset); in _cpuset_setthread()
1529 if (set) in _cpuset_setthread()
1530 cpuset_rel(set); in _cpuset_setthread()
1632 * 0 - The root set which should represent all valid processors in the
1633 * system. This set is immutable.
1634 * 1 - The default set which all processes are a member of until changed.
1637 * 2 - The kernel set which allows restriction and policy to be applied only
1643 struct cpuset *set; in cpuset_thread0() local
1653 * Create the root system set (0) for the whole machine. Doesn't use in cpuset_thread0()
1656 set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); in cpuset_thread0()
1657 CPU_COPY(&all_cpus, &set->cs_mask); in cpuset_thread0()
1658 LIST_INIT(&set->cs_children); in cpuset_thread0()
1659 LIST_INSERT_HEAD(&cpuset_ids, set, cs_link); in cpuset_thread0()
1660 refcount_init(&set->cs_ref, 1); in cpuset_thread0()
1661 set->cs_flags = CPU_SET_ROOT | CPU_SET_RDONLY; in cpuset_thread0()
1662 set->cs_domain = domainset0; in cpuset_thread0()
1663 cpuset_zero = set; in cpuset_thread0()
1664 cpuset_root = &set->cs_mask; in cpuset_thread0()
1667 * Now derive a default (1), modifiable set from that to give out. in cpuset_thread0()
1669 set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); in cpuset_thread0()
1670 error = cpuset_init(set, cpuset_zero, NULL, NULL, 1); in cpuset_thread0()
1671 KASSERT(error == 0, ("Error creating default set: %d\n", error)); in cpuset_thread0()
1672 cpuset_default = set; in cpuset_thread0()
1674 * Create the kernel set (2). in cpuset_thread0()
1676 set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO); in cpuset_thread0()
1677 error = cpuset_init(set, cpuset_zero, NULL, NULL, 2); in cpuset_thread0()
1678 KASSERT(error == 0, ("Error creating kernel set: %d\n", error)); in cpuset_thread0()
1679 set->cs_domain = domainset2; in cpuset_thread0()
1680 cpuset_kernel = set; in cpuset_thread0()
1703 struct cpuset *set; in cpuset_kernthread() local
1706 set = td->td_cpuset; in cpuset_kernthread()
1709 cpuset_rel(set); in cpuset_kernthread()
1714 * mark the new 'set' as root.
1719 * In case of no error, returns the set in *setp locked with a reference.
1724 struct cpuset *set; in cpuset_create_root() local
1730 set = NULL; in cpuset_create_root()
1731 error = cpuset_create(&set, pr->pr_cpuset, &pr->pr_cpuset->cs_mask); in cpuset_create_root()
1735 KASSERT(set != NULL, ("[%s:%d] cpuset_create returned invalid data", in cpuset_create_root()
1738 /* Mark the set as root. */ in cpuset_create_root()
1739 set->cs_flags |= CPU_SET_ROOT; in cpuset_create_root()
1740 *setp = set; in cpuset_create_root()
1746 cpuset_setproc_update_set(struct proc *p, struct cpuset *set) in cpuset_setproc_update_set() argument
1751 KASSERT(set != NULL, ("[%s:%d] invalid set", __func__, __LINE__)); in cpuset_setproc_update_set()
1753 cpuset_ref(set); in cpuset_setproc_update_set()
1754 error = cpuset_setproc(p->p_pid, set, NULL, NULL, true); in cpuset_setproc_update_set()
1757 cpuset_rel(set); in cpuset_setproc_update_set()
1806 * are set as a function pointer in cpuset_copy_cb struct and called by
1848 struct cpuset *set; in sys_cpuset() local
1854 set = NULL; in sys_cpuset()
1855 error = cpuset_create(&set, root, &root->cs_mask); in sys_cpuset()
1859 error = copyout(&set->cs_id, uap->setid, sizeof(set->cs_id)); in sys_cpuset()
1861 error = cpuset_setproc(-1, set, NULL, NULL, false); in sys_cpuset()
1862 cpuset_rel(set); in sys_cpuset()
1884 struct cpuset *set; in kern_cpuset_setid() local
1892 set = cpuset_lookup(setid, td); in kern_cpuset_setid()
1893 if (set == NULL) in kern_cpuset_setid()
1895 error = cpuset_setproc(id, set, NULL, NULL, false); in kern_cpuset_setid()
1896 cpuset_rel(set); in kern_cpuset_setid()
1921 struct cpuset *set; in kern_cpuset_getid() local
1929 error = cpuset_which(which, id, &p, &ttd, &set); in kern_cpuset_getid()
1937 set = cpuset_refbase(ttd->td_cpuset); in kern_cpuset_getid()
1950 nset = cpuset_refroot(set); in kern_cpuset_getid()
1951 cpuset_rel(set); in kern_cpuset_getid()
1952 set = nset; in kern_cpuset_getid()
1959 tmpid = set->cs_id; in kern_cpuset_getid()
1960 cpuset_rel(set); in kern_cpuset_getid()
1990 struct cpuset *set; in kern_cpuset_getaffinity() local
1997 error = cpuset_which2(&which, id, &p, &ttd, &set); in kern_cpuset_getaffinity()
2007 set = cpuset_ref(ttd->td_cpuset); in kern_cpuset_getaffinity()
2020 nset = cpuset_refroot(set); in kern_cpuset_getaffinity()
2022 nset = cpuset_refbase(set); in kern_cpuset_getaffinity()
2042 CPU_COPY(&set->cs_mask, mask); in kern_cpuset_getaffinity()
2061 if (set) in kern_cpuset_getaffinity()
2062 cpuset_rel(set); in kern_cpuset_getaffinity()
2136 struct cpuset *set; in kern_cpuset_setaffinity() local
2153 error = cpuset_which(which, id, &p, &ttd, &set); in kern_cpuset_setaffinity()
2161 set = cpuset_ref(ttd->td_cpuset); in kern_cpuset_setaffinity()
2175 nset = cpuset_refroot(set); in kern_cpuset_setaffinity()
2177 nset = cpuset_refbase(set); in kern_cpuset_setaffinity()
2180 cpuset_rel(set); in kern_cpuset_setaffinity()
2199 error = cpuset_which(which, id, &p, &ttd, &set); in kern_cpuset_setaffinity()
2201 error = cpuset_modify(set, mask); in kern_cpuset_setaffinity()
2202 cpuset_rel(set); in kern_cpuset_setaffinity()
2236 * Verify that no high bits are set. in user_cpuset_setaffinity()
2291 struct cpuset *set; in kern_cpuset_getdomain() local
2305 error = cpuset_which2(&which, id, &p, &ttd, &set); in kern_cpuset_getdomain()
2315 set = cpuset_ref(ttd->td_cpuset); in kern_cpuset_getdomain()
2329 nset = cpuset_refroot(set); in kern_cpuset_getdomain()
2331 nset = cpuset_refbase(set); in kern_cpuset_getdomain()
2356 domainset_copy(set->cs_domain, &outset); in kern_cpuset_getdomain()
2370 if (set) in kern_cpuset_getdomain()
2371 cpuset_rel(set); in kern_cpuset_getdomain()
2375 * Translate prefer into a set containing only the preferred domain, in kern_cpuset_getdomain()
2376 * not the entire fallback set. in kern_cpuset_getdomain()
2417 struct cpuset *set; in kern_cpuset_setdomain() local
2439 * Verify that no high bits are set. in kern_cpuset_setdomain()
2491 error = cpuset_which(which, id, &p, &ttd, &set); in kern_cpuset_setdomain()
2499 set = cpuset_ref(ttd->td_cpuset); in kern_cpuset_setdomain()
2514 nset = cpuset_refroot(set); in kern_cpuset_setdomain()
2516 nset = cpuset_refbase(set); in kern_cpuset_setdomain()
2519 cpuset_rel(set); in kern_cpuset_setdomain()
2538 error = cpuset_which(which, id, &p, &ttd, &set); in kern_cpuset_setdomain()
2540 error = cpuset_modify_domain(set, &domain); in kern_cpuset_setdomain()
2541 cpuset_rel(set); in kern_cpuset_setdomain()
2564 ddb_display_bitset(const struct bitset *set, int size) in ddb_display_bitset() argument
2569 if (CPU_ISSET(bit, set)) { in ddb_display_bitset()
2582 ddb_display_cpuset(const cpuset_t *set) in ddb_display_cpuset() argument
2584 ddb_display_bitset((const struct bitset *)set, CPU_SETSIZE); in ddb_display_cpuset()
2588 ddb_display_domainset(const domainset_t *set) in ddb_display_domainset() argument
2590 ddb_display_bitset((const struct bitset *)set, DOMAINSET_SETSIZE); in ddb_display_domainset()
2595 struct cpuset *set; in DB_SHOW_COMMAND_FLAGS() local
2597 LIST_FOREACH(set, &cpuset_ids, cs_link) { in DB_SHOW_COMMAND_FLAGS()
2598 db_printf("set=%p id=%-6u ref=%-6d flags=0x%04x parent id=%d\n", in DB_SHOW_COMMAND_FLAGS()
2599 set, set->cs_id, refcount_load(&set->cs_ref), set->cs_flags, in DB_SHOW_COMMAND_FLAGS()
2600 (set->cs_parent != NULL) ? set->cs_parent->cs_id : 0); in DB_SHOW_COMMAND_FLAGS()
2602 ddb_display_cpuset(&set->cs_mask); in DB_SHOW_COMMAND_FLAGS()
2605 set->cs_domain->ds_policy, set->cs_domain->ds_prefer); in DB_SHOW_COMMAND_FLAGS()
2606 ddb_display_domainset(&set->cs_domain->ds_mask); in DB_SHOW_COMMAND_FLAGS()
2615 struct domainset *set; in DB_SHOW_COMMAND_FLAGS() local
2617 LIST_FOREACH(set, &cpuset_domains, ds_link) { in DB_SHOW_COMMAND_FLAGS()
2618 db_printf("set=%p policy %d prefer %d cnt %d\n", in DB_SHOW_COMMAND_FLAGS()
2619 set, set->ds_policy, set->ds_prefer, set->ds_cnt); in DB_SHOW_COMMAND_FLAGS()
2621 ddb_display_domainset(&set->ds_mask); in DB_SHOW_COMMAND_FLAGS()