ia64/xen-unstable

view patches/linux-2.6.18/softlockup-no-idle-hz.patch @ 14131:64d80037e524

Save elfnotes in VM sxpr under image/notes, and load them on restore.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
author kfraser@localhost.localdomain
date Mon Feb 26 09:59:56 2007 +0000 (2007-02-26)
parents 1a411820230b
children 818da23b7571
line source
1 diff -pruN ../orig-linux-2.6.18/include/linux/sched.h ./include/linux/sched.h
2 --- ../orig-linux-2.6.18/include/linux/sched.h 2006-09-20 04:42:06.000000000 +0100
3 +++ ./include/linux/sched.h 2007-02-07 01:10:24.000000000 +0000
4 @@ -211,10 +211,15 @@ extern void update_process_times(int use
5 extern void scheduler_tick(void);
7 #ifdef CONFIG_DETECT_SOFTLOCKUP
8 +extern unsigned long softlockup_get_next_event(void);
9 extern void softlockup_tick(void);
10 extern void spawn_softlockup_task(void);
11 extern void touch_softlockup_watchdog(void);
12 #else
13 +static inline unsigned long softlockup_get_next_event(void)
14 +{
15 + return MAX_JIFFY_OFFSET;
16 +}
17 static inline void softlockup_tick(void)
18 {
19 }
20 diff -pruN ../orig-linux-2.6.18/kernel/softlockup.c ./kernel/softlockup.c
21 --- ../orig-linux-2.6.18/kernel/softlockup.c 2006-09-20 04:42:06.000000000 +0100
22 +++ ./kernel/softlockup.c 2007-02-07 01:53:22.000000000 +0000
23 @@ -40,6 +40,19 @@ void touch_softlockup_watchdog(void)
24 }
25 EXPORT_SYMBOL(touch_softlockup_watchdog);
27 +unsigned long softlockup_get_next_event(void)
28 +{
29 + int this_cpu = smp_processor_id();
30 + unsigned long touch_timestamp = per_cpu(touch_timestamp, this_cpu);
31 +
32 + if (per_cpu(print_timestamp, this_cpu) == touch_timestamp ||
33 + did_panic ||
34 + !per_cpu(watchdog_task, this_cpu))
35 + return MAX_JIFFY_OFFSET;
36 +
37 + return min_t(long, 0, touch_timestamp + HZ - jiffies);
38 +}
39 +
40 /*
41 * This callback runs from the timer interrupt, and checks
42 * whether the watchdog thread has hung or not:
43 diff -pruN ../orig-linux-2.6.18/kernel/timer.c ./kernel/timer.c
44 --- ../orig-linux-2.6.18/kernel/timer.c 2006-09-20 04:42:06.000000000 +0100
45 +++ ./kernel/timer.c 2007-02-07 01:29:34.000000000 +0000
46 @@ -485,7 +485,9 @@ unsigned long next_timer_interrupt(void)
47 if (hr_expires < 3)
48 return hr_expires + jiffies;
49 }
50 - hr_expires += jiffies;
51 + hr_expires = min_t(unsigned long,
52 + softlockup_get_next_event(),
53 + hr_expires) + jiffies;
55 base = __get_cpu_var(tvec_bases);
56 spin_lock(&base->lock);