From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752971AbbBYTAh (ORCPT ); Wed, 25 Feb 2015 14:00:37 -0500 Received: from e35.co.us.ibm.com ([32.97.110.153]:46891 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751479AbbBYTAg (ORCPT ); Wed, 25 Feb 2015 14:00:36 -0500 Date: Wed, 25 Feb 2015 11:00:28 -0800 From: "Paul E. McKenney" To: Yao Dongdong Cc: josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, laijs@cn.fujitsu.com, linux-kernel@vger.kernel.org, lizefan@huawei.com Subject: Re: [PATCH] rcu: Remove reduplicate check of cpu_online Message-ID: <20150225190028.GP15405@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <1424855386-8280-1-git-send-email-yaodongdong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424855386-8280-1-git-send-email-yaodongdong@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15022519-0013-0000-0000-000009070F75 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 25, 2015 at 05:09:46PM +0800, Yao Dongdong wrote: > The calling function invoke_rcu_core will check it. > > Signed-off-by: Yao Dongdong Hmmm... That is a fastpath, but invoke_rcu_core() is visible to the compiler, which should inline anyway. I took this patch for 4.1, but updated the title and commit log as follows: rcu: Remove redundant check of cpu_online() Because invoke_cpu_core() checks whether the current CPU is online, there is no need for __call_rcu_core() to redundantly check it. There should not be any performance degradation because the called function is visible to the compiler. This commit therefore removes the redundant check. Thanx, Paul > --- > kernel/rcu/tree.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 48d640c..e5f9b7e 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2741,7 +2741,7 @@ static void __call_rcu_core(struct rcu_state *rsp, struct rcu_data *rdp, > * If called from an extended quiescent state, invoke the RCU > * core in order to force a re-evaluation of RCU's idleness. > */ > - if (!rcu_is_watching() && cpu_online(smp_processor_id())) > + if (!rcu_is_watching()) > invoke_rcu_core(); > > /* If interrupts were disabled or CPU offline, don't invoke RCU core. */ > -- > 1.7.9.5 >