]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
Reduce side effects of handling '*' debug key
authorKeir Fraser <keir@xen.org>
Wed, 15 Dec 2010 12:06:56 +0000 (12:06 +0000)
committerKeir Fraser <keir@xen.org>
Wed, 15 Dec 2010 12:06:56 +0000 (12:06 +0000)
NMI watchdog should be suppressed when dumping IRQ handlers. Softirqs
should be handled periodically while processing non-IRQ handlers.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   22538:a3a29e67aa7e
xen-unstable date:        Wed Dec 15 12:04:34 2010 +0000

xen/common/keyhandler.c
xen/common/softirq.c
xen/include/xen/softirq.h

index 2419c74d014a15ce5f6e20ced0361d7c1129fba0..5ddd489a0e41d6faa417bb5c5fa46a4975d0b546 100644 (file)
@@ -375,16 +375,15 @@ static void run_all_nonirq_keyhandlers(unsigned long unused)
     struct keyhandler *h;
     int k;
 
-    console_start_log_everything();
     for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
     {
+        process_pending_softirqs_nested();
         h = key_table[k];
         if ( (h == NULL) || !h->diagnostic || h->irq_callback )
             continue;
         printk("[%c: %s]\n", k, h->desc);
         (*h->u.fn)(k);
     }
-    console_end_log_everything();
 }
 
 static DECLARE_TASKLET(run_all_keyhandlers_tasklet,
@@ -395,10 +394,11 @@ static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
     struct keyhandler *h;
     int k;
 
+    watchdog_disable();
+
     printk("'%c' pressed -> firing all diagnostic keyhandlers\n", key);
 
     /* Fire all the IRQ-context diangostic keyhandlers now */
-    console_start_log_everything();
     for ( k = 0; k < ARRAY_SIZE(key_table); k++ )
     {
         h = key_table[k];
@@ -407,7 +407,8 @@ static void run_all_keyhandlers(unsigned char key, struct cpu_user_regs *regs)
         printk("[%c: %s]\n", k, h->desc);
         (*h->u.irq_fn)(k, regs);
     }
-    console_end_log_everything();
+
+    watchdog_enable();
 
     /* Trigger the others from a tasklet in non-IRQ context */
     tasklet_schedule(&run_all_keyhandlers_tasklet);
index 7b04f36f2d45ba1d45adfa3b7c4802d60963b0bc..906b51ea42ce9f7924da19c37aa1622219a55c3b 100644 (file)
@@ -54,6 +54,16 @@ void process_pending_softirqs(void)
     __do_softirq(1ul<<SCHEDULE_SOFTIRQ);
 }
 
+void process_pending_softirqs_nested(void)
+{
+    ASSERT(!in_irq() && local_irq_is_enabled());
+    /*
+     * Do not enter scheduler as it can preempt the calling context,
+     * and do not run tasklets as we're running one currently.
+     */
+    __do_softirq((1ul<<SCHEDULE_SOFTIRQ) | (1ul<<TASKLET_SOFTIRQ));
+}
+
 asmlinkage void do_softirq(void)
 {
     __do_softirq(0);
index b02c8e2509069a8a5b9f6af72321162c433c4e47..2c9dba7cb154d47a4bfaf17ff76ac3865eb10e2e 100644 (file)
@@ -39,6 +39,8 @@ void raise_softirq(unsigned int nr);
  * Use this instead of do_softirq() when you do not want to be preempted.
  */
 void process_pending_softirqs(void);
+/* ... and use this instead when running inside a tasklet. */
+void process_pending_softirqs_nested(void);
 
 /*
  * TASKLETS -- dynamically-allocatable tasks run in softirq context