From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [patch] sched: make cpu_clock() not use the rq clock
Date: Sat, 28 Jul 2007 23:03:08 -0700 [thread overview]
Message-ID: <46AC2D9C.3080307@goop.org> (raw)
In-Reply-To: <20070726090012.GA5287@elte.hu>
Ingo Molnar wrote:
> Subject: sched: make cpu_clock() not use the rq clock
>
This subject doesn't make much sense to me. All this patch does is get
the rq's current time under irq_disable rather than spinlock, right?
J
> From: Ingo Molnar <mingo@elte.hu>
>
> it is enough to disable interrupts to get the precise rq-clock
> of the local CPU.
>
> this also solves an NMI watchdog regression: the NMI watchdog
> calls touch_softlockup_watchdog(), which might deadlock on
> rq->lock if the NMI hits an rq-locked critical section.
>
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
> kernel/sched.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> Index: linux-rt-rebase.q/kernel/sched.c
> ===================================================================
> --- linux-rt-rebase.q.orig/kernel/sched.c
> +++ linux-rt-rebase.q/kernel/sched.c
> @@ -446,13 +446,12 @@ static inline unsigned long long rq_cloc
> */
> unsigned long long cpu_clock(int cpu)
> {
> - struct rq *rq = cpu_rq(cpu);
> unsigned long long now;
> unsigned long flags;
>
> - spin_lock_irqsave(&rq->lock, flags);
> - now = rq_clock(rq);
> - spin_unlock_irqrestore(&rq->lock, flags);
> + local_irq_save(flags);
> + now = rq_clock(cpu_rq(cpu));
> + local_irq_restore(flags);
>
> return now;
> }
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2007-07-29 6:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 9:00 [patch] sched: make cpu_clock() not use the rq clock Ingo Molnar
2007-07-27 2:56 ` Eric St-Laurent
2007-07-29 6:03 ` Jeremy Fitzhardinge [this message]
2007-07-29 21:17 ` Ingo Molnar
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=46AC2D9C.3080307@goop.org \
--to=jeremy@goop.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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