From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751272AbbCIXts (ORCPT ); Mon, 9 Mar 2015 19:49:48 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:38721 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbbCIXtr (ORCPT ); Mon, 9 Mar 2015 19:49:47 -0400 Date: Mon, 9 Mar 2015 16:49:43 -0700 From: "Paul E. McKenney" To: Alexander Gordeev Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/10] rcu: Cleanup RCU tree initialization Message-ID: <20150309234943.GA23932@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150309214021.GD5236@linux.vnet.ibm.com> <20150309233947.GA16995@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150309233947.GA16995@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15030923-0033-0000-0000-000003E77685 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 09, 2015 at 04:39:47PM -0700, Paul E. McKenney wrote: > On Mon, Mar 09, 2015 at 02:40:21PM -0700, Paul E. McKenney wrote: > > On Mon, Mar 09, 2015 at 09:34:04AM +0100, Alexander Gordeev wrote: > > > Hi Paul, > > > > > > Here is cleanup of RCU tree initialization rebased on linux-rcu rcu/next > > > repo, as you requested. Please, note an extra patch #10 that was not > > > present in the first post. > > > > > > The series successfully passes kernel build test with CONFIG_RCU_FANOUT > > > and CONFIG_RCU_FANOUT_LEAF equal to 5. > > > > I queued up 1-9, as discussed and have started testing. I will let you > > know how it goes. > > Initial testing went well except for the following warning: > > /home/paulmck/public_git/linux-rcu/kernel/rcu/tree.c: In function ‘rcu_init_one.isra.63’: > /home/paulmck/public_git/linux-rcu/kernel/rcu/tree.c:3961:3: warning: ‘levelcnt[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized] > for (j = 0; j < levelcnt[i]; j++, rnp++) { > > This warning looks like a false positive to me, given that the loop > near the beginning of the function initializes levelcnt[0]. Am I > missing something here, and either way, what is the best way to shut > this warning up? My suggestion is the following: if (rcu_num_lvls <= 0) panic("rcu_init_one: rcu_num_lvls underflow"); Just following the other panic() in rcu_init_one(). Thanx, Paul > I am using gcc version 4.8.2. > > This warning only appears for some configurations. > SRCU-N: Four CPUs, single rcu_node structure. > SRCU-P: Eight CPUs, single rcu_node structure. > TASKS01: Two CPUs, single rcu_node structure. > TASKS03: Two CPUs, single rcu_node structure. > TREE09: Single CPU, single rcu_node structure. > > All the other TREE0N configurations have multiple rcu_node structures. > > TASKS02 didn't warn either despite having only one CPU, but that is > because it uses Tiny RCU instead of Tree RCU. > > So this warning shows up only in the case where the compiler knows > that the rcu_node tree consists of only one rcu_node structure. > > Thanx, Paul > > > > Cc: "Paul E. McKenney" > > > > > > > > > Alexander Gordeev (10): > > > rcu: Panic if RCU tree can not accommodate all CPUs > > > rcu: Remove superfluous local variable in rcu_init_geometry() > > > rcu: Cleanup rcu_init_geometry() code and arithmetics > > > rcu: Simplify rcu_init_geometry() capacity arithmetics > > > rcu: Limit rcu_state::levelcnt[] to RCU_NUM_LVLS items > > > rcu: Limit rcu_capacity[] size to RCU_NUM_LVLS items > > > rcu: Remove unnecessary fields from rcu_state structure > > > rcu: Limit count of static data to the number of RCU levels > > > rcu: Simplify arithmetic to calculate number of RCU nodes > > > rcu: Remove unnecessary grpnum field from rcu_node structure > > > > > > kernel/rcu/tree.c | 102 ++++++++++++++++++++--------------------------- > > > kernel/rcu/tree.h | 35 ++++++++-------- > > > kernel/rcu/tree_plugin.h | 4 +- > > > 3 files changed, 63 insertions(+), 78 deletions(-) > > > > > > -- > > > 1.8.3.1 > > >