From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760571AbaGYPZ6 (ORCPT ); Fri, 25 Jul 2014 11:25:58 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:60798 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760415AbaGYPZ4 (ORCPT ); Fri, 25 Jul 2014 11:25:56 -0400 Date: Fri, 25 Jul 2014 08:25:51 -0700 From: "Paul E. McKenney" To: Pranith Kumar Cc: Josh Triplett , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , "open list:READ-COPY UPDATE..." Subject: Re: [PATCH v2 2/2] rcu: Check the return value of rcu_nocb_mask cpumask allocation Message-ID: <20140725152551.GC11241@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1406248652-17416-1-git-send-email-bobby.prani@gmail.com> <1406248652-17416-2-git-send-email-bobby.prani@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1406248652-17416-2-git-send-email-bobby.prani@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14072515-7164-0000-0000-00000360EFA9 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 24, 2014 at 08:37:32PM -0400, Pranith Kumar wrote: > This commit checks the return value of the zalloc_cpumask_var() used for > allocating cpumask for rcu_nocb_mask. > > Signed-off-by: Pranith Kumar Hmmm... I saw the check in the previous patch, but didn't see removal of the later have_rcu_nocb_mask check. Please see below. Thanx, Paul > --- > v2: no change from v1 > > kernel/rcu/tree_plugin.h | 23 ++++++++++++----------- > 1 file changed, 12 insertions(+), 11 deletions(-) > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > index 520538a..9c9a01c 100644 > --- a/kernel/rcu/tree_plugin.h > +++ b/kernel/rcu/tree_plugin.h > @@ -54,7 +54,10 @@ static void __init rcu_bootup_announce_oddness_nocb(void) > { > #ifndef CONFIG_RCU_NOCB_CPU_NONE > if (!have_rcu_nocb_mask) { > - zalloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL); > + if (!zalloc_cpumask_var(&rcu_nocb_mask, GFP_KERNEL)) { > + pr_info("rcu_nocb_mask allocation failed\n"); > + return; > + } > have_rcu_nocb_mask = true; > } > #ifdef CONFIG_RCU_NOCB_CPU_ZERO > @@ -66,17 +69,15 @@ static void __init rcu_bootup_announce_oddness_nocb(void) > cpumask_copy(rcu_nocb_mask, cpu_possible_mask); > #endif /* #ifdef CONFIG_RCU_NOCB_CPU_ALL */ > #endif /* #ifndef CONFIG_RCU_NOCB_CPU_NONE */ > - if (have_rcu_nocb_mask) { > - if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) { > - pr_info("\tNote: kernel parameter 'rcu_nocbs=' contains nonexistent CPUs.\n"); > - cpumask_and(rcu_nocb_mask, cpu_possible_mask, > - rcu_nocb_mask); > - } > - cpulist_scnprintf(nocb_buf, sizeof(nocb_buf), rcu_nocb_mask); > - pr_info("\tOffload RCU callbacks from CPUs: %s.\n", nocb_buf); > - if (rcu_nocb_poll) > - pr_info("\tPoll for callbacks from no-CBs CPUs.\n"); > + if (!cpumask_subset(rcu_nocb_mask, cpu_possible_mask)) { What happens if CONFIG_RCU_NOCB_CPU_NONE=y and the rcu_nocbs= boot parameter is not specified and we get here? In order to get visible failures when testing, build with CONFIG_CPUMASK_OFFSTACK=y. > + pr_info("\tNote: kernel parameter 'rcu_nocbs=' contains nonexistent CPUs.\n"); > + cpumask_and(rcu_nocb_mask, cpu_possible_mask, > + rcu_nocb_mask); > } > + cpulist_scnprintf(nocb_buf, sizeof(nocb_buf), rcu_nocb_mask); > + pr_info("\tOffload RCU callbacks from CPUs: %s.\n", nocb_buf); > + if (rcu_nocb_poll) > + pr_info("\tPoll for callbacks from no-CBs CPUs.\n"); > } > > /* > -- > 2.0.1 >