aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXunlei Pang <xlpang@redhat.com>2015-12-02 06:52:59 -0500
committerIngo Molnar <mingo@kernel.org>2015-12-04 04:16:21 -0500
commit8295c69925ad53ec32ca54ac9fc194ff21bc40e2 (patch)
treece03eb3301bc8d24afd0359d804b7a5d9a2ae93f
parent119d6f6a3be8b424b200dcee56e74484d5445f7e (diff)
sched/core: Clear the root_domain cpumasks in init_rootdomain()
root_domain::rto_mask allocated through alloc_cpumask_var() contains garbage data, this may cause problems. For instance, When doing pull_rt_task(), it may do useless iterations if rto_mask retains some extra garbage bits. Worse still, this violates the isolated domain rule for clustered scheduling using cpuset, because the tasks(with all the cpus allowed) belongs to one root domain can be pulled away into another root domain. The patch cleans the garbage by using zalloc_cpumask_var() instead of alloc_cpumask_var() for root_domain::rto_mask allocation, thereby addressing the issues. Do the same thing for root_domain's other cpumask memembers: dlo_mask, span, and online. Signed-off-by: Xunlei Pang <xlpang@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: <stable@vger.kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1449057179-29321-1-git-send-email-xlpang@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fc8c9879113c..eee4ee655db2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5846,13 +5846,13 @@ static int init_rootdomain(struct root_domain *rd)
5846{ 5846{
5847 memset(rd, 0, sizeof(*rd)); 5847 memset(rd, 0, sizeof(*rd));
5848 5848
5849 if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) 5849 if (!zalloc_cpumask_var(&rd->span, GFP_KERNEL))
5850 goto out; 5850 goto out;
5851 if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) 5851 if (!zalloc_cpumask_var(&rd->online, GFP_KERNEL))
5852 goto free_span; 5852 goto free_span;
5853 if (!alloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL)) 5853 if (!zalloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL))
5854 goto free_online; 5854 goto free_online;
5855 if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) 5855 if (!zalloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
5856 goto free_dlo_mask; 5856 goto free_dlo_mask;
5857 5857
5858 init_dl_bw(&rd->dl_bw); 5858 init_dl_bw(&rd->dl_bw);