提交 8295c699 编写于 作者: X Xunlei Pang 提交者: Ingo Molnar

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: NXunlei Pang <xlpang@redhat.com>
Signed-off-by: NPeter 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.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 119d6f6a
...@@ -5846,13 +5846,13 @@ static int init_rootdomain(struct root_domain *rd) ...@@ -5846,13 +5846,13 @@ static int init_rootdomain(struct root_domain *rd)
{ {
memset(rd, 0, sizeof(*rd)); memset(rd, 0, sizeof(*rd));
if (!alloc_cpumask_var(&rd->span, GFP_KERNEL)) if (!zalloc_cpumask_var(&rd->span, GFP_KERNEL))
goto out; goto out;
if (!alloc_cpumask_var(&rd->online, GFP_KERNEL)) if (!zalloc_cpumask_var(&rd->online, GFP_KERNEL))
goto free_span; goto free_span;
if (!alloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL)) if (!zalloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL))
goto free_online; goto free_online;
if (!alloc_cpumask_var(&rd->rto_mask, GFP_KERNEL)) if (!zalloc_cpumask_var(&rd->rto_mask, GFP_KERNEL))
goto free_dlo_mask; goto free_dlo_mask;
init_dl_bw(&rd->dl_bw); init_dl_bw(&rd->dl_bw);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册