aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2011-03-08 14:18:21 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2011-03-08 14:18:21 +0000
commite84c2db1377c75e5aa1b9b6c99ba80f5ae7230f8 (patch)
treecdc3f7679e6dc309830c198844c559d8a5cb0568 /sys
parent87cd3ddacc57ac0cf06391186b1bdcb3eabfcac0 (diff)
downloadsrc-e84c2db1377c75e5aa1b9b6c99ba80f5ae7230f8.tar.gz
src-e84c2db1377c75e5aa1b9b6c99ba80f5ae7230f8.zip
When constructing a new cpuset, apply the parent cpuset's mask to the new
set's mask rather than the root mask. This was causing the root mask to be modified incorrectly. Reviewed by: jeff MFC after: 1 week
Notes
Notes: svn path=/head/; revision=219399
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_cpuset.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c
index c5eb6594e2bf..bf9eac79ac8e 100644
--- a/sys/kern/kern_cpuset.c
+++ b/sys/kern/kern_cpuset.c
@@ -249,7 +249,7 @@ cpuset_lookup(cpusetid_t setid, struct thread *td)
* will have no valid cpu based on restrictions from the parent.
*/
static int
-_cpuset_create(struct cpuset *set, struct cpuset *parent, cpuset_t *mask,
+_cpuset_create(struct cpuset *set, struct cpuset *parent, const cpuset_t *mask,
cpusetid_t id)
{
@@ -260,7 +260,7 @@ _cpuset_create(struct cpuset *set, struct cpuset *parent, cpuset_t *mask,
refcount_init(&set->cs_ref, 1);
set->cs_flags = 0;
mtx_lock_spin(&cpuset_lock);
- CPU_AND(mask, &parent->cs_mask);
+ CPU_AND(&set->cs_mask, &parent->cs_mask);
set->cs_id = id;
set->cs_parent = cpuset_ref(parent);
LIST_INSERT_HEAD(&parent->cs_children, set, cs_siblings);
@@ -277,7 +277,7 @@ _cpuset_create(struct cpuset *set, struct cpuset *parent, cpuset_t *mask,
* allocated.
*/
static int
-cpuset_create(struct cpuset **setp, struct cpuset *parent, cpuset_t *mask)
+cpuset_create(struct cpuset **setp, struct cpuset *parent, const cpuset_t *mask)
{
struct cpuset *set;
cpusetid_t id;
@@ -475,7 +475,7 @@ cpuset_which(cpuwhich_t which, id_t id, struct proc **pp, struct thread **tdp,
* the new set is a child of 'set'.
*/
static int
-cpuset_shadow(struct cpuset *set, struct cpuset *fset, cpuset_t *mask)
+cpuset_shadow(struct cpuset *set, struct cpuset *fset, const cpuset_t *mask)
{
struct cpuset *parent;