Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754812AbcCAXwF (ORCPT ); Tue, 1 Mar 2016 18:52:05 -0500 Received: from mail333.us4.mandrillapp.com ([205.201.137.77]:42851 "EHLO mail333.us4.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753986AbcCAXwA (ORCPT ); Tue, 1 Mar 2016 18:52:00 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; q=dns; s=mandrill; d=linuxfoundation.org; b=M//1J5KYCWFLpnZcL6YiNAzukCFLhiDWQ56wfWGWccssnYqubWJWGiG6eywNmxOGmscJD+Ao8BBv GTkMa6OdKBNzP4AvF70IkqwUC+S6XjDHO0QxEa5Kz6GuHGYg4x7pat38JxSrisIQa+SlxKDd/LtR 2eiyAS4B+JqNze2i8nM=; From: Greg Kroah-Hartman Subject: [PATCH 3.14 073/130] sched/core: Clear the root_domain cpumasks in init_rootdomain() X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Xunlei Pang , "Peter Zijlstra (Intel)" , Linus Torvalds , Mike Galbraith , Steven Rostedt , Thomas Gleixner , Ingo Molnar Message-Id: <20160301234502.393076465@linuxfoundation.org> In-Reply-To: <20160301234459.768886030@linuxfoundation.org> References: <20160301234459.768886030@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.0983eb7bc53d45dd91c5ca87a260ca68 X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:51:16 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2152 Lines: 59 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xunlei Pang commit 8295c69925ad53ec32ca54ac9fc194ff21bc40e2 upstream. 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 Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1449057179-29321-1-git-send-email-xlpang@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- kernel/sched/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -5420,13 +5420,13 @@ static int init_rootdomain(struct root_d { 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);