[RFC v2 6/7] touch softlockup watchdog

Glauber Costa
2010-08-30T16:23:58Z

With a reliable steal time mechanism, we can tell if we're
out of the cpu for very long, differentiating from the case
that we simply got a real softlockup.

In the case we were out of cpu, the watchdog is fed, making
bogus softlockups disappear.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
arch/x86/kernel/kvmclock.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index a1f4852..d217475 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -91,6 +91,7 @@ cputime_t kvm_get_steal_time(void)
{
u64 delta = 0;
u64 *last_steal_info, this_steal_info;
+ int touch_wd;
struct pvclock_vcpu_time_info *src;

src = &get_cpu_var(hv_clock);
@@ -104,6 +105,10 @@ cputime_t kvm_get_steal_time(void)

delta = this_steal_info - *last_steal_info;

+ touch_wd = softlockup_thresh * 1000UL;
+ if ((touch_wd > 0) && (delta > touch_wd))
+ touch_softlockup_watchdog();
+
*last_steal_info = this_steal_info;
put_cpu_var(steal_info);

--
1.6.2.2