From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753719Ab1KCXGR (ORCPT ); Thu, 3 Nov 2011 19:06:17 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:41049 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750865Ab1KCXGQ (ORCPT ); Thu, 3 Nov 2011 19:06:16 -0400 X-Originating-IP: 217.70.178.145 X-Originating-IP: 168.103.236.33 Date: Thu, 3 Nov 2011 16:05:53 -0700 From: Josh Triplett To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, patches@linaro.org, "Paul E. McKenney" Subject: Re: [PATCH RFC tip/core/rcu 28/28] rcu: Fix idle-task checks Message-ID: <20111103230552.GB2838@leaf> References: <20111102203017.GA3830@linux.vnet.ibm.com> <1320265849-5744-28-git-send-email-paulmck@linux.vnet.ibm.com> <20111103045509.GH2042@leaf> <20111103210005.GK2287@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111103210005.GK2287@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 03, 2011 at 02:00:05PM -0700, Paul E. McKenney wrote: > On Wed, Nov 02, 2011 at 09:55:09PM -0700, Josh Triplett wrote: > > On Wed, Nov 02, 2011 at 01:30:49PM -0700, Paul E. McKenney wrote: > > > From: Paul E. McKenney > > > > > > RCU has traditionally relied on idle_cpu() to determine whether a given > > > CPU is running in the context of an idle task, but recent changes have > > > invalidated this approach. This commit therefore switches from idle_cpu > > > to "current->pid != 0". > > > > Could you elaborate a bit on "recent changes"? It looks like you mean > > commit 908a3283728d92df36e0c7cd63304fd35e93a8a9; if so, could you add > > that reference to the commit message? > > Will do! > > > Also, the hard-coded use of "current->pid != 0" concerns me. Could this > > use some existing function? Does idle_task() help? If no appropriate > > predicate exists, perhaps it should. is_idle_task(current)? > > I could use idle_task(), but that does quite a bit more work. Doesn't seem that high-overhead, but *shrug*. > The hard-coded "current->pid != 0" is used in a number of other places > in the kernel, so there is precedent. Well, 2 is a number, yes: arch/sparc/kernel/setup_32.c: if(current->pid != 0) { kernel/events/core.c: if (!(event->attr.exclude_idle && current->pid == 0)) > Might be worth fixing globally > as a separate fix, though. Fair enough. - Josh Triplett