diff options
Diffstat (limited to 'kernel/softlockup.c')
| -rw-r--r-- | kernel/softlockup.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/softlockup.c b/kernel/softlockup.c index d22579087e2..0d4c7898ab8 100644 --- a/kernel/softlockup.c +++ b/kernel/softlockup.c | |||
| @@ -25,6 +25,7 @@ static DEFINE_SPINLOCK(print_lock); | |||
| 25 | static DEFINE_PER_CPU(unsigned long, softlockup_touch_ts); /* touch timestamp */ | 25 | static DEFINE_PER_CPU(unsigned long, softlockup_touch_ts); /* touch timestamp */ |
| 26 | static DEFINE_PER_CPU(unsigned long, softlockup_print_ts); /* print timestamp */ | 26 | static DEFINE_PER_CPU(unsigned long, softlockup_print_ts); /* print timestamp */ |
| 27 | static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog); | 27 | static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog); |
| 28 | static DEFINE_PER_CPU(bool, softlock_touch_sync); | ||
| 28 | 29 | ||
| 29 | static int __read_mostly did_panic; | 30 | static int __read_mostly did_panic; |
| 30 | int __read_mostly softlockup_thresh = 60; | 31 | int __read_mostly softlockup_thresh = 60; |
| @@ -79,6 +80,12 @@ void touch_softlockup_watchdog(void) | |||
| 79 | } | 80 | } |
| 80 | EXPORT_SYMBOL(touch_softlockup_watchdog); | 81 | EXPORT_SYMBOL(touch_softlockup_watchdog); |
| 81 | 82 | ||
| 83 | void touch_softlockup_watchdog_sync(void) | ||
| 84 | { | ||
| 85 | __raw_get_cpu_var(softlock_touch_sync) = true; | ||
| 86 | __raw_get_cpu_var(softlockup_touch_ts) = 0; | ||
| 87 | } | ||
| 88 | |||
| 82 | void touch_all_softlockup_watchdogs(void) | 89 | void touch_all_softlockup_watchdogs(void) |
| 83 | { | 90 | { |
| 84 | int cpu; | 91 | int cpu; |
| @@ -118,6 +125,14 @@ void softlockup_tick(void) | |||
| 118 | } | 125 | } |
| 119 | 126 | ||
| 120 | if (touch_ts == 0) { | 127 | if (touch_ts == 0) { |
| 128 | if (unlikely(per_cpu(softlock_touch_sync, this_cpu))) { | ||
| 129 | /* | ||
| 130 | * If the time stamp was touched atomically | ||
| 131 | * make sure the scheduler tick is up to date. | ||
| 132 | */ | ||
| 133 | per_cpu(softlock_touch_sync, this_cpu) = false; | ||
| 134 | sched_clock_tick(); | ||
| 135 | } | ||
| 121 | __touch_softlockup_watchdog(); | 136 | __touch_softlockup_watchdog(); |
| 122 | return; | 137 | return; |
| 123 | } | 138 | } |
