[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090612095650.61863c41@dhcp-lab-109.englab.brq.redhat.com>
Date: Fri, 12 Jun 2009 09:56:50 +0200
From: Stanislaw Gruszka <sgruszka@...hat.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Thomas Gleixner <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH 1/2] posix-cpu-timers: avoid do_sys_times() races with
__exit_signal()
On Fri, 12 Jun 2009 09:09:58 +0200
Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:
> On Fri, 2009-06-12 at 08:49 +0200, Stanislaw Gruszka wrote:
> > Protect thread_group_cputime() call by siglock, to avoid possible (but
> > to be honest - very improbable) double times accounting of exiting task.
> > This is revert of commit 2b5fe6de58276d0b5a7c884d5dbfc300ca47db78
> > "thread_group_cputime: move a couple of callsites outside of ->siglock",
> > but implementation of thread_group_cputime() was different then.
>
> Would be nice to have a description of exactly how you'd end up
> accounting twice (and thus how this patch fixes it).
In thread_group_cputime() we loop on all threads within the group to sum
they cputimes. After finish loop, we add killed tasks times from tsk->signal.
If thread (one or more) exit in gap between loop and adding killed tasks
times, __exit_signal() function add already accounted times to tsk->signal.
So some exiting threads times could be accounted twice.
Stanislaw
--
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