lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111103230552.GB2838@leaf>
Date:	Thu, 3 Nov 2011 16:05:53 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, laijs@...fujitsu.com,
	dipankar@...ibm.com, akpm@...ux-foundation.org,
	mathieu.desnoyers@...ymtl.ca, niv@...ibm.com, tglx@...utronix.de,
	peterz@...radead.org, rostedt@...dmis.org, Valdis.Kletnieks@...edu,
	dhowells@...hat.com, eric.dumazet@...il.com, darren@...art.com,
	patches@...aro.org, "Paul E. McKenney" <paul.mckenney@...aro.org>
Subject: Re: [PATCH RFC tip/core/rcu 28/28] rcu: Fix idle-task checks

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 <paul.mckenney@...aro.org>
> > > 
> > > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ