Re: [PATCH RFC tip/core/rcu 28/28] rcu: Fix idle-task checks

From: Paul E. McKenney
Date: Thu Nov 03 2011 - 17:00:46 EST


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@xxxxxxxxxx>
> >
> > 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.
The hard-coded "current->pid != 0" is used in a number of other places
in the kernel, so there is precedent. Might be worth fixing globally
as a separate fix, though.

Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/