Author: jhb
Date: Tue Mar  8 14:18:21 2011
New Revision: 219399
URL: http://svn.freebsd.org/changeset/base/219399

Log:
  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

Modified:
  head/sys/kern/kern_cpuset.c

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c Tue Mar  8 12:08:23 2011        (r219398)
+++ head/sys/kern/kern_cpuset.c Tue Mar  8 14:18:21 2011        (r219399)
@@ -249,7 +249,7 @@ cpuset_lookup(cpusetid_t setid, struct t
  * 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, struc
        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, struc
  * 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, 
  * 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;
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to