diff options
author | jhb <jhb@FreeBSD.org> | 2011-03-08 14:18:21 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-03-08 14:18:21 +0000 |
commit | 269e1daa8fe439dcd0d7320b0f334d69afbf872e (patch) | |
tree | cdc3f7679e6dc309830c198844c559d8a5cb0568 /sys/kern/kern_cpuset.c | |
parent | 3acee14718d1768b45d7d06cda30a8f4b3a49ccd (diff) | |
download | FreeBSD-src-269e1daa8fe439dcd0d7320b0f334d69afbf872e.zip FreeBSD-src-269e1daa8fe439dcd0d7320b0f334d69afbf872e.tar.gz |
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
Diffstat (limited to 'sys/kern/kern_cpuset.c')
-rw-r--r-- | sys/kern/kern_cpuset.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_cpuset.c b/sys/kern/kern_cpuset.c index c5eb659..bf9eac7 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; |