Re: [PATCH v2 11/12] cpuset: allow writing offlined masks to cpuset.cpus/mems
On Fri, Oct 11, 2013 at 05:51:54PM +0800, Li Zefan wrote: > As the configured masks won't be limited by its parent, and the top > cpuset's masks won't change when hotplug happens, it's natural to > allow writing offlined masks to the configured masks. > > Signed-off-by; Li Zefan > --- > kernel/cpuset.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/kernel/cpuset.c b/kernel/cpuset.c > index e71c04f..a98723d 100644 > --- a/kernel/cpuset.c > +++ b/kernel/cpuset.c > @@ -960,7 +960,8 @@ static int update_cpumask(struct cpuset *cs, struct > cpuset *trialcs, > if (retval < 0) > return retval; > > - if (!cpumask_subset(trialcs->cpus_allowed, cpu_active_mask)) > + if (!cpumask_subset(trialcs->cpus_allowed, > + top_cpuset.cpus_allowed)) Shouldn't this gated by sane_behavior? > > @@ -1238,8 +1239,8 @@ static int update_nodemask(struct cpuset *cs, struct > cpuset *trialcs, > goto done; > > if (!nodes_subset(trialcs->mems_allowed, > - node_states[N_MEMORY])) { > - retval = -EINVAL; > + top_cpuset.mems_allowed)) { > + retval = -EINVAL; Ditto. Thanks. -- tejun -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 11/12] cpuset: allow writing offlined masks to cpuset.cpus/mems
On Fri, Oct 11, 2013 at 05:51:54PM +0800, Li Zefan wrote: As the configured masks won't be limited by its parent, and the top cpuset's masks won't change when hotplug happens, it's natural to allow writing offlined masks to the configured masks. Signed-off-by; Li Zefan lize...@huawei.com --- kernel/cpuset.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index e71c04f..a98723d 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -960,7 +960,8 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, if (retval 0) return retval; - if (!cpumask_subset(trialcs-cpus_allowed, cpu_active_mask)) + if (!cpumask_subset(trialcs-cpus_allowed, + top_cpuset.cpus_allowed)) Shouldn't this gated by sane_behavior? @@ -1238,8 +1239,8 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, goto done; if (!nodes_subset(trialcs-mems_allowed, - node_states[N_MEMORY])) { - retval = -EINVAL; + top_cpuset.mems_allowed)) { + retval = -EINVAL; Ditto. Thanks. -- tejun -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 11/12] cpuset: allow writing offlined masks to cpuset.cpus/mems
As the configured masks won't be limited by its parent, and the top cpuset's masks won't change when hotplug happens, it's natural to allow writing offlined masks to the configured masks. Signed-off-by; Li Zefan --- kernel/cpuset.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index e71c04f..a98723d 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -960,7 +960,8 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, if (retval < 0) return retval; - if (!cpumask_subset(trialcs->cpus_allowed, cpu_active_mask)) + if (!cpumask_subset(trialcs->cpus_allowed, + top_cpuset.cpus_allowed)) return -EINVAL; } @@ -1238,8 +1239,8 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, goto done; if (!nodes_subset(trialcs->mems_allowed, - node_states[N_MEMORY])) { - retval = -EINVAL; + top_cpuset.mems_allowed)) { + retval = -EINVAL; goto done; } } -- 1.8.0.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 11/12] cpuset: allow writing offlined masks to cpuset.cpus/mems
As the configured masks won't be limited by its parent, and the top cpuset's masks won't change when hotplug happens, it's natural to allow writing offlined masks to the configured masks. Signed-off-by; Li Zefan lize...@huawei.com --- kernel/cpuset.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/cpuset.c b/kernel/cpuset.c index e71c04f..a98723d 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@ -960,7 +960,8 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, if (retval 0) return retval; - if (!cpumask_subset(trialcs-cpus_allowed, cpu_active_mask)) + if (!cpumask_subset(trialcs-cpus_allowed, + top_cpuset.cpus_allowed)) return -EINVAL; } @@ -1238,8 +1239,8 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, goto done; if (!nodes_subset(trialcs-mems_allowed, - node_states[N_MEMORY])) { - retval = -EINVAL; + top_cpuset.mems_allowed)) { + retval = -EINVAL; goto done; } } -- 1.8.0.2 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/