[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070725090439.GA26286@elte.hu>
Date: Wed, 25 Jul 2007 11:04:39 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Jeremy Fitzhardinge <jeremy@...p.org>,
linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
stable@...nel.org, Greg KH <greg@...ah.com>,
Chris Wright <chrisw@...s-sol.org>
Subject: Re: [patch] fix the softlockup watchdog to actually work
* Andrew Morton <akpm@...ux-foundation.org> wrote:
> > softlockup-add-irq-regs-h.patch
> > softlockup-better-printout.patch
> > softlockup-cleanups.patch
> > softlockup-use-cpu-clock.patch
> >
> > they are all necessary.
>
> I think I have. Seems that someone hasn't been naming their patches
> consistently (which is quite irksome). I have:
>
> fix-the-softlockup-watchdog-to-actually-work.patch
> softlockup-make-asm-irq_regsh-available-on-every-platform.patch
> softlockup-improve-debug-output.patch
> softlockup-watchdog-style-cleanups.patch
> softlockup-add-a-proc-tuning-parameter.patch
> softlockup-add-a-proc-tuning-parameter-fix.patch
you have the key one missing i think - attached below.
Ingo
------------------------------------>
Subject: softlockup: use cpu_clock() instead of sched_clock()
From: Ingo Molnar <mingo@...e.hu>
sched_clock() is not a reliable time-source, use cpu_clock() instead.
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/softlockup.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: linux/kernel/softlockup.c
===================================================================
--- linux.orig/kernel/softlockup.c
+++ linux/kernel/softlockup.c
@@ -42,14 +42,16 @@ static struct notifier_block panic_block
* resolution, and we don't need to waste time with a big divide when
* 2^30ns == 1.074s.
*/
-static unsigned long get_timestamp(void)
+static unsigned long get_timestamp(int this_cpu)
{
- return sched_clock() >> 30; /* 2^30 ~= 10^9 */
+ return cpu_clock(this_cpu) >> 30; /* 2^30 ~= 10^9 */
}
void touch_softlockup_watchdog(void)
{
- __raw_get_cpu_var(touch_timestamp) = get_timestamp();
+ int this_cpu = raw_smp_processor_id();
+
+ per_cpu(touch_timestamp, this_cpu) = get_timestamp(this_cpu);
}
EXPORT_SYMBOL(touch_softlockup_watchdog);
@@ -95,7 +97,7 @@ void softlockup_tick(void)
return;
}
- now = get_timestamp();
+ now = get_timestamp(this_cpu);
/* Wake up the high-prio watchdog task every second: */
if (now > (touch_timestamp + 1))
-
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