Skip to contentSkip to conversation

xen/common: Process softirqs while dumping domains

PATCH In review Andrew Cooper 2 participants 2 messages Oct 29, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/common: Process softirqs while dumping domains

Process softirqs once per domain, and once every 64 vcpus in a guest to avoid being hit by the NMI watchdog. Discovered against a VM which had accidentally been assigned 8192 vcpus.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Konrad Rzeszutek Wilk <[email protected]>
---
 xen/common/keyhandler.c |    9 +++++++++
 1 file changed, 9 insertions(+)
xen/common/keyhandler.c +9 -0
index 809378c..c9d9206 100644
@@ -253,6 +253,9 @@ static void dump_domains(unsigned char key)
     for_each_domain ( d )
     {
         unsigned int i;
+
+        process_pending_softirqs();
+
         printk("General information for domain %u:\n", d->domain_id);
         cpuset_print(tmpstr, sizeof(tmpstr), d->domain_dirty_cpumask);
         printk("    refcnt=%d dying=%d pause_count=%d\n",
@@ -287,6 +290,9 @@ static void dump_domains(unsigned char key)
                d->domain_id);
         for_each_vcpu ( d, v )
         {
+            if ( (v->vcpu_id & 0x3f) == 0 )
+                process_pending_softirqs();
+
             printk("    VCPU%d: CPU%d [has=%c] poll=%d "
                    "upcall_pend = %02x, upcall_mask = %02x ",
                    v->vcpu_id, v->processor,
@@ -311,6 +317,9 @@ static void dump_domains(unsigned char key)
     {
         for_each_vcpu ( d, v )
         {
+            if ( (v->vcpu_id & 0x3f) == 0 )
+                process_pending_softirqs();
+
             printk("Notifying guest %d:%d (virq %d, port %d)\n",
                    d->domain_id, v->vcpu_id,
                    VIRQ_DEBUG, v->virq_to_evtchn[VIRQ_DEBUG]);
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Andrew Cooper

Process softirqs once per domain, and once every 64 vcpus in a guest to avoid being hit by the NMI watchdog. Discovered against a VM which had accidentally been assigned 8192 vcpus.

Personally...

xen/common/keyhandler.c static void dump_domains(unsigned char key) · line 296

Quoted 13 lines
xen/common/keyhandler.c +3 -0
index 809378c..c9d9206 100644
@@ -287,6 +290,9 @@ static void dump_domains(unsigned char key)
                d->domain_id);
         for_each_vcpu ( d, v )
         {
+            if ( (v->vcpu_id & 0x3f) == 0 )
+                process_pending_softirqs();
+
 

... I think something like ( vcpu_id % 64 ) would have been more readable, but I understand that's only a matter of taste. :-)

Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel