Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1283754

[tip:locking/core] sched/core: Clear the root_domain cpumasks in init_rootdomain()

From tip-bot for Xunlei Pang <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:locking/core] sched/core: Clear the root_domain cpumasks in init_rootdomain()
Date 2015-12-04 13:00 +0100
Message-ID <qBXbU-2b5-73@gated-at.bofh.it> (permalink)
References <qBeeK-6GK-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  8295c69925ad53ec32ca54ac9fc194ff21bc40e2
Gitweb:     http://git.kernel.org/tip/8295c69925ad53ec32ca54ac9fc194ff21bc40e2
Author:     Xunlei Pang <xlpang@redhat.com>
AuthorDate: Wed, 2 Dec 2015 19:52:59 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 4 Dec 2015 10:16:21 +0100

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>
---
 kernel/sched/core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fc8c987..eee4ee6 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5846,13 +5846,13 @@ static int init_rootdomain(struct root_domain *rd)
 {
 	memset(rd, 0, sizeof(*rd));
 
-	if (!alloc_cpumask_var(&rd->span, GFP_KERNEL))
+	if (!zalloc_cpumask_var(&rd->span, GFP_KERNEL))
 		goto out;
-	if (!alloc_cpumask_var(&rd->online, GFP_KERNEL))
+	if (!zalloc_cpumask_var(&rd->online, GFP_KERNEL))
 		goto free_span;
-	if (!alloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL))
+	if (!zalloc_cpumask_var(&rd->dlo_mask, GFP_KERNEL))
 		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;
 
 	init_dl_bw(&rd->dl_bw);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] sched/core: Clear the root_domain cpumasks in init_rootdomain() Xunlei Pang <xlpang@redhat.com> - 2015-12-02 13:00 +0100
  Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Peter Zijlstra <peterz@infradead.org> - 2015-12-02 13:40 +0100
    Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Xunlei Pang <xlpang@redhat.com> - 2015-12-02 14:20 +0100
      Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Peter Zijlstra <peterz@infradead.org> - 2015-12-02 17:30 +0100
        Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Xunlei Pang <xlpang@redhat.com> - 2015-12-03 03:50 +0100
          Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Ingo Molnar <mingo@kernel.org> - 2015-12-03 09:30 +0100
            Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Xunlei Pang <xlpang@redhat.com> - 2015-12-03 13:00 +0100
              Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Ingo Molnar <mingo@kernel.org> - 2015-12-04 09:10 +0100
                Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Peter Zijlstra <peterz@infradead.org> - 2015-12-04 09:30 +0100
                Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Ingo Molnar <mingo@kernel.org> - 2015-12-04 09:40 +0100
                Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Xunlei Pang <xlpang@redhat.com> - 2015-12-04 09:30 +0100
                Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Ingo Molnar <mingo@kernel.org> - 2015-12-04 09:40 +0100
          Re: [PATCH] sched/core: Clear the root_domain cpumasks in  init_rootdomain() Peter Zijlstra <peterz@infradead.org> - 2015-12-03 10:40 +0100
  [tip:locking/core] sched/core:   Clear the root_domain cpumasks in init_rootdomain() tip-bot for Xunlei Pang <tipbot@zytor.com> - 2015-12-04 13:00 +0100

csiph-web