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: <CAOtvUMegNxbb4OHRo6cB3EWT6R0F0rpzZAd8d=pxoHjehSCgKw@mail.gmail.com>
Date:	Tue, 27 Mar 2012 16:10:49 +0200
From:	Gilad Ben-Yossef <gilad@...yossef.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	linaro-sched-sig@...ts.linaro.org,
	Alessio Igor Bogani <abogani@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Avi Kivity <avi@...hat.com>,
	Chris Metcalf <cmetcalf@...era.com>,
	Christoph Lameter <cl@...ux.com>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Geoff Levand <geoff@...radead.org>,
	Ingo Molnar <mingo@...nel.org>,
	Max Krasnyansky <maxk@...lcomm.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Stephen Hemminger <shemminger@...tta.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Sven-Thorsten Dietrich <thebigcorporation@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Zen Lin <zen@...nhuawei.org>
Subject: Re: [PATCH 21/32] nohz/cpuset: Flush cputime on threads in nohz
 cpusets when waiting leader

On Wed, Mar 21, 2012 at 3:58 PM, Frederic Weisbecker <fweisbec@...il.com> wrote:
> When we wait for a zombie task, flush the cputimes on nohz cpusets
> in case we are waiting for a group leader that has threads running
> in nohz CPUs. This way thread_group_times() doesn't report stale
> values.
>
> <doubts>
> If I understood well the code, by the time we call that thread_group_times(),
> we may have childs that are still running, so this is necessary.
> But I need to check deeper.
> </doubts>
>
...
>
> diff --git a/kernel/exit.c b/kernel/exit.c
> index 4b4042f..c194662 100644
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -52,6 +52,7 @@
>  #include <linux/hw_breakpoint.h>
>  #include <linux/oom.h>
>  #include <linux/writeback.h>
> +#include <linux/cpuset.h>
>
>  #include <asm/uaccess.h>
>  #include <asm/unistd.h>
> @@ -1712,6 +1713,13 @@ repeat:
>           (!wo->wo_pid || hlist_empty(&wo->wo_pid->tasks[wo->wo_type])))
>                goto notask;
>
> +       /*
> +        * For cputime in sub-threads before adding them.
> +        * Must be called outside tasklist_lock lock because write lock
> +        * can be acquired under irqs disabled.
> +        */
> +       cpuset_nohz_flush_cputimes();
> +
>        set_current_state(TASK_INTERRUPTIBLE);
>        read_lock(&tasklist_lock);
>        tsk = current;
> --
> 1.7.5.4
>

I believe this patch is not needed because after this point we call
do_wait_thread /ptrace_do_wait, which both call wait_consider_task,
which calls wait_task_stopped/zombie/continued, which all eventually
calls getrusage, which calls k_getrusage where you added a call to
cpuset_noz_flush_cputimes() in another patch :-)

Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker
gilad@...yossef.com
Israel Cell: +972-52-8260388
US Cell: +1-973-8260388
http://benyossef.com

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
--
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