[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Avoid triggering the softlockup BUG when offline for too long.


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>
  • Date: Fri, 24 Nov 2006 11:10:23 -0200
  • Delivery-date: Fri, 24 Nov 2006 05:10:19 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

After being offline for a long time, the softlockup  watchdog triggers
a BUG() on our faces. This is expected, as in fact, we spent more than
a fixed 10*HZ amount of time without touching the watchdog.

However, by inspecting the contents of RUNSTATE_offline, we can gain
awareness of the fact, and do better than that. This patch fixes it.

Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>


-- 
Glauber de Oliveira Costa
Red Hat Inc.
"Free as in Freedom"
# HG changeset patch
# User gcosta@xxxxxxxxxx
# Date 1164376767 18000
# Node ID 0f235d94eeabbca64c14ae6d5ae3708870522f60
# Parent  47fcd5f768fef50cba2fc6dbadc7b75de55e88a5
[LINUX] Avoid triggering the softlockup BUG when offline for too long.

After being offline for a long time, the softlockup  watchdog triggers
a BUG() on our faces. This is expected, as in fact, we spent more than
a fixed 10*HZ amount of time without touching the watchdog.

However, by inspecting the contents of RUNSTATE_offline, we can gain
awareness of the fact, and do better than that. This patch fixes it.

Signed-off-by: Glauber de Oliveira Costa <gcosta@xxxxxxxxxx>

diff -r 47fcd5f768fe -r 0f235d94eeab 
linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c  Fri Nov 17 08:30:43 
2006 -0500
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c  Fri Nov 24 08:59:27 
2006 -0500
@@ -129,6 +129,8 @@ static DEFINE_PER_CPU(u64, processed_sys
 /* How much CPU time was spent blocked and how much was 'stolen'? */
 static DEFINE_PER_CPU(u64, processed_stolen_time);
 static DEFINE_PER_CPU(u64, processed_blocked_time);
+/* How much time did we spend offline? */
+static DEFINE_PER_CPU(u64, offline_time);
 
 /* Current runstate of each CPU (updated automatically by the hypervisor). */
 static DEFINE_PER_CPU(struct vcpu_runstate_info, runstate);
@@ -607,7 +609,7 @@ EXPORT_SYMBOL(profile_pc);
 
 irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-       s64 delta, delta_cpu, stolen, blocked;
+       s64 delta, delta_cpu, stolen, blocked, offline;
        u64 sched_time;
        int i, cpu = smp_processor_id();
        struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu);
@@ -636,6 +638,8 @@ irqreturn_t timer_interrupt(int irq, voi
                                per_cpu(processed_stolen_time, cpu);
                        blocked = runstate->time[RUNSTATE_blocked] -
                                per_cpu(processed_blocked_time, cpu);
+                       offline = runstate->time[RUNSTATE_offline] -
+                               per_cpu(offline_time, cpu);
                        barrier();
                } while (sched_time != runstate->state_entry_time);
        } while (!time_values_up_to_date(cpu));
@@ -710,6 +714,13 @@ irqreturn_t timer_interrupt(int irq, voi
                                            (cputime_t)delta_cpu);
        }
 
+       /* We know we were offline for too long, avoid triggering the 
+        * softlockup_tick bug */
+       if ((offline > 10*HZ)) {
+               touch_softlockup_watchdog();
+               per_cpu(offline_time, cpu) += offline;
+       }
+
        /* Local timer processing (see update_process_times()). */
        run_local_timers();
        if (rcu_pending(cpu))
@@ -734,6 +745,8 @@ static void init_missing_ticks_accountin
                runstate->time[RUNSTATE_blocked];
        per_cpu(processed_stolen_time, cpu) =
                runstate->time[RUNSTATE_runnable] +
+               runstate->time[RUNSTATE_offline];
+       per_cpu(offline_time, cpu) =
                runstate->time[RUNSTATE_offline];
 }
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.