From: Greg Kroah-Hartman Date: Tue, 20 Nov 2007 17:16:37 +0000 (-0800) Subject: another softlockup patch for .23 X-Git-Tag: v2.6.22.14~4 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=b30dcbfc92169bea2bd194b1d4483f8cb0345fa8;p=thirdparty%2Fkernel%2Fstable-queue.git another softlockup patch for .23 --- diff --git a/queue-2.6.23/series b/queue-2.6.23/series index ab0cbd8091d..61824216d6e 100644 --- a/queue-2.6.23/series +++ b/queue-2.6.23/series @@ -23,3 +23,4 @@ x98-return-correct-error-code-from-child-rip.patch ntp-fix-sync-cmos-clock-typo.patch x86-fix-rtc-locking.patch softlockup-watchdog-fixes-and-cleanups.patch +softlockup-use-cpu_clock-instead-of-sched_clock.patch diff --git a/queue-2.6.23/softlockup-use-cpu_clock-instead-of-sched_clock.patch b/queue-2.6.23/softlockup-use-cpu_clock-instead-of-sched_clock.patch new file mode 100644 index 00000000000..56c67f698b7 --- /dev/null +++ b/queue-2.6.23/softlockup-use-cpu_clock-instead-of-sched_clock.patch @@ -0,0 +1,51 @@ +From a3b13c23f186ecb57204580cc1f2dbe9c284953a Mon Sep 17 00:00:00 2001 +From: Ingo Molnar +Date: Tue, 16 Oct 2007 23:26:06 -0700 +Subject: [PATCH] softlockup: use cpu_clock() instead of sched_clock() + +From: Ingo Molnar + +patch a3b13c23f186ecb57204580cc1f2dbe9c284953a in mainline. + +sched_clock() is not a reliable time-source, use cpu_clock() instead. + +Signed-off-by: Ingo Molnar +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/softlockup.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/kernel/softlockup.c ++++ b/kernel/softlockup.c +@@ -43,14 +43,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(); ++ ++ __raw_get_cpu_var(touch_timestamp) = get_timestamp(this_cpu); + } + EXPORT_SYMBOL(touch_softlockup_watchdog); + +@@ -96,7 +98,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))