diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-22 22:25:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-22 22:25:09 -0500 |
commit | 3b5d8510b94a95e493e8c4951ffc3d1cf6a6792d (patch) | |
tree | 4493367715c7a15e9057e6c72fa3c3edfd0605ad /kernel/watchdog.c | |
parent | c47f39e3b75e1138823984ad5079547c7a41b726 (diff) | |
parent | 41ef8f826692c8f65882bec0a8211bd4d1d2d19a (diff) |
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core locking changes from Ingo Molnar:
"The biggest change is the rwsem lock-steal improvements, both to the
assembly optimized and the spinlock based variants.
The other notable change is the clean up of the seqlock implementation
to be based on the seqcount infrastructure.
The rest is assorted smaller debuggability, cleanup and continued -rt
locking changes."
* 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
rwsem-spinlock: Implement writer lock-stealing for better scalability
futex: Revert "futex: Mark get_robust_list as deprecated"
generic: Use raw local irq variant for generic cmpxchg
lockdep: Selftest: convert spinlock to raw spinlock
seqlock: Use seqcount infrastructure
seqlock: Remove unused functions
ntp: Make ntp_lock raw
intel_idle: Convert i7300_idle_lock to raw_spinlock
locking: Various static lock initializer fixes
lockdep: Print more info when MAX_LOCK_DEPTH is exceeded
rwsem: Implement writer lock-stealing for better scalability
lockdep: Silence warning if CONFIG_LOCKDEP isn't set
watchdog: Use local_clock for get_timestamp()
lockdep: Rename print_unlock_inbalance_bug() to print_unlock_imbalance_bug()
locking/stat: Fix a typo
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r-- | kernel/watchdog.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 27689422aa92..4a944676358e 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -113,9 +113,9 @@ static int get_softlockup_thresh(void) | |||
113 | * resolution, and we don't need to waste time with a big divide when | 113 | * resolution, and we don't need to waste time with a big divide when |
114 | * 2^30ns == 1.074s. | 114 | * 2^30ns == 1.074s. |
115 | */ | 115 | */ |
116 | static unsigned long get_timestamp(int this_cpu) | 116 | static unsigned long get_timestamp(void) |
117 | { | 117 | { |
118 | return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */ | 118 | return local_clock() >> 30LL; /* 2^30 ~= 10^9 */ |
119 | } | 119 | } |
120 | 120 | ||
121 | static void set_sample_period(void) | 121 | static void set_sample_period(void) |
@@ -133,9 +133,7 @@ static void set_sample_period(void) | |||
133 | /* Commands for resetting the watchdog */ | 133 | /* Commands for resetting the watchdog */ |
134 | static void __touch_watchdog(void) | 134 | static void __touch_watchdog(void) |
135 | { | 135 | { |
136 | int this_cpu = smp_processor_id(); | 136 | __this_cpu_write(watchdog_touch_ts, get_timestamp()); |
137 | |||
138 | __this_cpu_write(watchdog_touch_ts, get_timestamp(this_cpu)); | ||
139 | } | 137 | } |
140 | 138 | ||
141 | void touch_softlockup_watchdog(void) | 139 | void touch_softlockup_watchdog(void) |
@@ -196,7 +194,7 @@ static int is_hardlockup(void) | |||
196 | 194 | ||
197 | static int is_softlockup(unsigned long touch_ts) | 195 | static int is_softlockup(unsigned long touch_ts) |
198 | { | 196 | { |
199 | unsigned long now = get_timestamp(smp_processor_id()); | 197 | unsigned long now = get_timestamp(); |
200 | 198 | ||
201 | /* Warn about unreasonable delays: */ | 199 | /* Warn about unreasonable delays: */ |
202 | if (time_after(now, touch_ts + get_softlockup_thresh())) | 200 | if (time_after(now, touch_ts + get_softlockup_thresh())) |