aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2007-05-08 03:28:05 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:06 -0400
commit04c9167f91e309c9c4ea982992aa08e83b2eb42e (patch)
treeb15e7bed8eb2e22e96971bbe3156a00683c70909
parent966812dc98e6a7fcdf759cbfa0efab77500a8868 (diff)
add touch_all_softlockup_watchdogs()
Add touch_all_softlockup_watchdogs() to allow the softlockup watchdog timers on all cpus to be updated. This is used to prevent sysrq-t from generating a spurious watchdog message when generating lots of output. Softlockup watchdogs use sched_clock() as its timebase, which is inherently per-cpu (at least, when it is measuring unstolen time). Because of this, it isn't possible for one CPU to directly update the other CPU's timers, but it is possible to tell the other CPUs to do update themselves appropriately. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Acked-by: Chris Lalancette <clalance@redhat.com> Signed-off-by: Prarit Bhargava <prarit@redhat.com> Cc: Rick Lindsley <ricklind@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/sched.h4
-rw-r--r--kernel/sched.c2
-rw-r--r--kernel/softlockup.c15
3 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d464bd0d6578..6312521df2c1 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -226,6 +226,7 @@ extern void scheduler_tick(void);
226extern void softlockup_tick(void); 226extern void softlockup_tick(void);
227extern void spawn_softlockup_task(void); 227extern void spawn_softlockup_task(void);
228extern void touch_softlockup_watchdog(void); 228extern void touch_softlockup_watchdog(void);
229extern void touch_all_softlockup_watchdogs(void);
229#else 230#else
230static inline void softlockup_tick(void) 231static inline void softlockup_tick(void)
231{ 232{
@@ -236,6 +237,9 @@ static inline void spawn_softlockup_task(void)
236static inline void touch_softlockup_watchdog(void) 237static inline void touch_softlockup_watchdog(void)
237{ 238{
238} 239}
240static inline void touch_all_softlockup_watchdogs(void)
241{
242}
239#endif 243#endif
240 244
241 245
diff --git a/kernel/sched.c b/kernel/sched.c
index 0227f1625a75..5530ed211f72 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4750,6 +4750,8 @@ void show_state_filter(unsigned long state_filter)
4750 show_task(p); 4750 show_task(p);
4751 } while_each_thread(g, p); 4751 } while_each_thread(g, p);
4752 4752
4753 touch_all_softlockup_watchdogs();
4754
4753 read_unlock(&tasklist_lock); 4755 read_unlock(&tasklist_lock);
4754 /* 4756 /*
4755 * Only show locks if all tasks are dumped: 4757 * Only show locks if all tasks are dumped:
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index 5ea631742dbc..8fa7040247ad 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -50,6 +50,16 @@ void touch_softlockup_watchdog(void)
50} 50}
51EXPORT_SYMBOL(touch_softlockup_watchdog); 51EXPORT_SYMBOL(touch_softlockup_watchdog);
52 52
53void touch_all_softlockup_watchdogs(void)
54{
55 int cpu;
56
57 /* Cause each CPU to re-update its timestamp rather than complain */
58 for_each_online_cpu(cpu)
59 per_cpu(touch_timestamp, cpu) = 0;
60}
61EXPORT_SYMBOL(touch_all_softlockup_watchdogs);
62
53/* 63/*
54 * This callback runs from the timer interrupt, and checks 64 * This callback runs from the timer interrupt, and checks
55 * whether the watchdog thread has hung or not: 65 * whether the watchdog thread has hung or not:
@@ -61,9 +71,10 @@ void softlockup_tick(void)
61 unsigned long print_timestamp; 71 unsigned long print_timestamp;
62 unsigned long now; 72 unsigned long now;
63 73
64 /* watchdog task hasn't updated timestamp yet */ 74 if (touch_timestamp == 0) {
65 if (touch_timestamp == 0) 75 touch_softlockup_watchdog();
66 return; 76 return;
77 }
67 78
68 print_timestamp = per_cpu(print_timestamp, this_cpu); 79 print_timestamp = per_cpu(print_timestamp, this_cpu);
69 80