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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111110172029.GB2354@linux.vnet.ibm.com>
Date:	Thu, 10 Nov 2011 09:20:30 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Wu Fengguang <fengguang.wu@...el.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...e.hu>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: Re: linux-next 20111025: warnings in
 rcu_idle_exit_common()/rcu_idle_enter_common()

On Thu, Nov 10, 2011 at 05:35:24PM +0100, Peter Zijlstra wrote:
> On Mon, 2011-10-31 at 15:14 -0700, Paul E. McKenney wrote:
> > Peter, I have been using "idle_cpu(smp_processor_id()))" to verify that
> > I really am running in the context of the idle task when RCU believes
> > that the current CPU has gone idle. 
> 
> I think this is sorted since, but just to clarify idle_cpu() was meant
> to test if the cpu was idle, this is something different from actually
> running the idle thread.

Thank you, and yes, looks like the ->pid==0 approach works well.

Should this be encapsulated, for example in an inline function something
as follows?

static inline void cpu_is_running_idle_task(struct task_struct *tsk)
{
	return tsk->pid == 0;
}

I am sure I could come up with a longer name, if you would prefer.  ;-)

I would be happy to create the patch and fix up the other open-coded
uses of ->pid==0 if this approach looks good to you.

							Thanx, Paul

--
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