Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760418AbbLCP1B (ORCPT ); Thu, 3 Dec 2015 10:27:01 -0500 Received: from smtprelay0038.hostedemail.com ([216.40.44.38]:58013 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758149AbbLCP07 (ORCPT ); Thu, 3 Dec 2015 10:26:59 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2693:2741:3138:3139:3140:3141:3142:3165:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4470:5007:6261:7875:7903:10004:10400:10450:10455:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12517:12519:12679:12740:13069:13255:13311:13357:14096:14097:14659:19904:19999:21080:30036:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: touch48_3cd9c05e12f51 X-Filterd-Recvd-Size: 2623 Date: Thu, 3 Dec 2015 10:26:57 -0500 From: Steven Rostedt To: Xunlei Pang Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar Subject: Re: [PATCH v2 1/3] sched/core: Clear the root_domain cpumasks in init_rootdomain() Message-ID: <20151203102657.44609f0b@gandalf.local.home> In-Reply-To: <1449117901-9561-1-git-send-email-xlpang@redhat.com> References: <1449117901-9561-1-git-send-email-xlpang@redhat.com> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1923 Lines: 52 On Thu, 3 Dec 2015 12:44:59 +0800 Xunlei Pang wrote: > root_domain::rto_mask allocated through alloc_cpumask_var() > contains garbage data with CONFIG_CPUMASK_OFFSTACK set, 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 can violate the isolated domain > rule for clustered scheduling using cpuset, because the tasks > (with all the cpus allowed) which belongs to one root domain > can be pulled away into another root domain. I really hate the fact that alloc_cpumask_var() behaves differently depending on weather or not CONFIG_CPUMASK_OFFSTACK is defined or not. I wonder if the better solution is to pass the __GFP_ZERO into allocating the cpu mask when CPUMASK_OFFSTACK is defined. This will prevent other areas from having this same bug. Also, I doubt any allocations of cpumasks is in performance critical sections. Or at least see if the address passed in is already null, which tells us that something already cleared it. Like in this case the memset(rd, 0, sizeof(*rd)). Have something like: bool alloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node) { if ((long)*mask == 0) flags |= __GFP_ZERO; Maybe I'll post a patch to do this. > > The patch cleans the garbage by passing alloc_cpumask_var() > with an extra __GFP_ZERO 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. Acked-by: Steven Rostedt -- Steve > > Signed-off-by: Xunlei Pang > --- -- 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/