From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Thomas Gleixner <tglx@linutronix.de>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [GIT PULL] core/locking changes for v3.2
Date: Wed, 26 Oct 2011 17:03:44 +0200 [thread overview]
Message-ID: <20111026150344.GA25000@elte.hu> (raw)
In-Reply-To: <CA+55aFw84RRBxT0QwDT6dg94OqreS8vwMq7Qog+o0QXqR8vgEA@mail.gmail.com>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Wed, Oct 26, 2011 at 3:25 PM, Ingo Molnar <mingo@elte.hu> wrote:
> >
> > Note, you will get a conflict in kernel/posix-cpu-timers.c, which i
> > resolved in -tip the following way:
> >
> > raw_spin_lock_irqsave(&cputimer->lock, flags);
> > if (!cputimer->running) {
> > cputimer->running = 1;
> > /*
> > * The POSIX timer interface allows for absolute time expiry
> > * values through the TIMER_ABSTIME flag, therefore we have
> > * to synchronize the timer to the clock every time we start
> > * it.
> > */
> > thread_group_cputime(tsk, &sum);
> > update_gt_cputime(&cputimer->cputime, &sum);
> > }
> > *times = cputimer->cputime;
> > raw_spin_unlock_irqrestore(&cputimer->lock, flags);
>
> That seems like a completely bogus resolution. You are
> re-introducing the incorrect ABBA nesting of cputimer->lock and
> rq->lock, and basically undoing commit bcd5cff7216f.
oh, i quoted the resolution from the pre-ABBA-fix tree :-/
The one in tip:master is:
void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)
{
struct thread_group_cputimer *cputimer = &tsk->signal->cputimer;
struct task_cputime sum;
unsigned long flags;
if (!cputimer->running) {
/*
* The POSIX timer interface allows for absolute time expiry
* values through the TIMER_ABSTIME flag, therefore we have
* to synchronize the timer to the clock every time we start
* it.
*/
thread_group_cputime(tsk, &sum);
raw_spin_lock_irqsave(&cputimer->lock, flags);
cputimer->running = 1;
update_gt_cputime(&cputimer->cputime, &sum);
} else
raw_spin_lock_irqsave(&cputimer->lock, flags);
*times = cputimer->cputime;
raw_spin_unlock_irqrestore(&cputimer->lock, flags);
}
Good thing you double checked it.
Thanks,
Ingo
prev parent reply other threads:[~2011-10-26 15:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-26 13:25 [GIT PULL] core/locking changes for v3.2 Ingo Molnar
2011-10-26 14:21 ` Linus Torvalds
2011-10-26 15:03 ` Ingo Molnar [this message]
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=20111026150344.GA25000@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/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