From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/2] posix-cpu-timers: avoid do_sys_times() races with __exit_signal()
Date: Fri, 12 Jun 2009 09:09:58 +0200 [thread overview]
Message-ID: <1244790598.6691.956.camel@laptop> (raw)
In-Reply-To: <20090612084910.1b63b0af@dhcp-lab-109.englab.brq.redhat.com>
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).
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
> kernel/sys.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/sys.c b/kernel/sys.c
> index e7998cf..0805d08 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -913,8 +913,8 @@ void do_sys_times(struct tms *tms)
> struct task_cputime cputime;
> cputime_t cutime, cstime;
>
> - thread_group_cputime(current, &cputime);
> spin_lock_irq(¤t->sighand->siglock);
> + thread_group_cputime(current, &cputime);
> cutime = current->signal->cutime;
> cstime = current->signal->cstime;
> spin_unlock_irq(¤t->sighand->siglock);
next prev parent reply other threads:[~2009-06-12 7:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 6:49 [PATCH 1/2] posix-cpu-timers: avoid do_sys_times() races with __exit_signal() Stanislaw Gruszka
2009-06-12 7:09 ` Peter Zijlstra [this message]
2009-06-12 7:56 ` Stanislaw Gruszka
-- strict thread matches above, loose matches on Subject: below --
2009-06-12 8:34 Stanislaw Gruszka
2009-06-12 13:46 ` Oleg Nesterov
2009-06-15 8:36 Stanislaw Gruszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1244790598.6691.956.camel@laptop \
--to=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@redhat.com \
--cc=sgruszka@redhat.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox