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]
Date:	Mon, 20 Dec 2010 16:57:42 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Ingo Molnar <mingo@...e.hu>,
	Steven Rostedt <rostedt@...dmis.org>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Anton Blanchard <anton@....ibm.com>,
	Tim Pepper <lnxninja@...ux.vnet.ibm.com>
Subject: Re: [RFC PATCH 15/15] nohz_task: Procfs interface

On Mon, Dec 20, 2010 at 04:42:24PM +0100, Peter Zijlstra wrote:
> On Mon, 2010-12-20 at 16:24 +0100, Frederic Weisbecker wrote:
> > This implements the /proc/pid/nohz file that enables the
> > nohz attribute of a task.
> > 
> > Synchronization is enforced so that:
> > 
> > - A CPU can have only one nohz task
> 
> Why?


This is because of the hooks we have with entering/exiting userspace.
The "wants to enter extended quiescent" variable (nohz_task_ext_qs)
is per CPU and applies to any nohz task.

If A and B are nohz task bound to the same CPU,

A enters userspace, says it can enter extended quiescent state
(nohz_task_ext_qs = 1).
B preempts it and enters kernel, hence saying that it doesn't want
extended quiescent state (nohz_task_ext_qs = 0). B sleeps, we return
to A which said that it wants extended quiescent state but the per cpu
var has been screwed (nohz_task_ext_qs == 0).

But this can be solved using a per task variable. I just thought it
wouldn't be very useful to have two nohz task on a same CPU, but actually
why not.
 
> > - A nohz task can be only affine to a single CPU
> 
> Why?

Same problem, we need to make some things per task. That's fixable,
This will may be add a bit of complexity and since I couldn't find
a usecase for migratable nohz tasks, I did not handled that case.

Should I?

> > For now this is only possible to write on /proc/self but probably
> > allowing it from another task would be a good idea and wouldn't
> > increase so much the complexity of the code. 
> 
> ptrace rules might match that.

You think I should use the ptrace interface? Hmm, dunno if it's
appropriate.
--
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