From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] reduce side effects of handling '*' debug key Date: Tue, 14 Dec 2010 14:46:23 +0000 Message-ID: <4D07914F0200007800027D39@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part8EA2C92F.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part8EA2C92F.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline NMI watchdog should be suppressed, and softirqs should be handled at least in the non-IRQ handler portion (they obviously must not be processed in IRQ context). The (slightly more involved) 4.0 variant of this patch is also attached. Signed-off-by: Jan Beulich --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -444,16 +444,21 @@ static void run_all_nonirq_keyhandlers(u struct keyhandler *h; int k; =20 - console_start_log_everything(); + watchdog_disable(); + console_start_sync(); + for ( k =3D 0; k < ARRAY_SIZE(key_table); k++ ) { + process_pending_softirqs(); h =3D key_table[k]; if ( (h =3D=3D NULL) || !h->diagnostic || h->irq_callback ) continue; printk("[%c: %s]\n", k, h->desc); (*h->u.fn)(k); } - console_end_log_everything(); + + console_end_sync(); + watchdog_enable(); } =20 static DECLARE_TASKLET(run_all_keyhandlers_tasklet, @@ -464,10 +469,12 @@ static void run_all_keyhandlers(unsigned struct keyhandler *h; int k; =20 + watchdog_disable(); + console_start_sync(); + printk("'%c' pressed -> firing all diagnostic keyhandlers\n", key); =20 /* Fire all the IRQ-context diangostic keyhandlers now */ - console_start_log_everything(); for ( k =3D 0; k < ARRAY_SIZE(key_table); k++ ) { h =3D key_table[k]; @@ -476,7 +483,9 @@ static void run_all_keyhandlers(unsigned printk("[%c: %s]\n", k, h->desc); (*h->u.irq_fn)(k, regs); } - console_end_log_everything(); + + console_end_sync(); + watchdog_enable(); =20 /* Trigger the others from a tasklet in non-IRQ context */ tasklet_schedule(&run_all_keyhandlers_tasklet); --=__Part8EA2C92F.0__= Content-Type: text/plain; name="keyhandler-relax.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="keyhandler-relax.patch" NMI watchdog should be suppressed, and softirqs should be handled = at=0Aleast in the non-IRQ handler portion (they obviously must not = be=0Aprocessed in IRQ context).=0A=0AThe (slightly more involved) 4.0 = variant of this patch is also=0Aattached.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/common/keyhandler.c=0A+++ b/xen/common= /keyhandler.c=0A@@ -444,16 +444,21 @@ static void run_all_nonirq_keyhandler= s(u=0A struct keyhandler *h;=0A int k;=0A =0A- console_start_log= _everything();=0A+ watchdog_disable();=0A+ console_start_sync();=0A+= =0A for ( k =3D 0; k < ARRAY_SIZE(key_table); k++ )=0A {=0A+ = process_pending_softirqs();=0A h =3D key_table[k];=0A if = ( (h =3D=3D NULL) || !h->diagnostic || h->irq_callback )=0A = continue;=0A printk("[%c: %s]\n", k, h->desc);=0A = (*h->u.fn)(k);=0A }=0A- console_end_log_everything();=0A+=0A+ = console_end_sync();=0A+ watchdog_enable();=0A }=0A =0A static DECLARE_TA= SKLET(run_all_keyhandlers_tasklet,=0A@@ -464,10 +469,12 @@ static void = run_all_keyhandlers(unsigned=0A struct keyhandler *h;=0A int k;=0A = =0A+ watchdog_disable();=0A+ console_start_sync();=0A+=0A = printk("'%c' pressed -> firing all diagnostic keyhandlers\n", key);=0A =0A = /* Fire all the IRQ-context diangostic keyhandlers now */=0A- = console_start_log_everything();=0A for ( k =3D 0; k < ARRAY_SIZE(key_ta= ble); k++ )=0A {=0A h =3D key_table[k];=0A@@ -476,7 +483,9 @@ = static void run_all_keyhandlers(unsigned=0A printk("[%c: %s]\n", = k, h->desc);=0A (*h->u.irq_fn)(k, regs);=0A }=0A- console_en= d_log_everything();=0A+=0A+ console_end_sync();=0A+ watchdog_enable()= ;=0A =0A /* Trigger the others from a tasklet in non-IRQ context */=0A = tasklet_schedule(&run_all_keyhandlers_tasklet);=0A --=__Part8EA2C92F.0__= Content-Type: text/plain; name="4.0-keyhandler-relax.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="4.0-keyhandler-relax.patch" NMI watchdog should be suppressed, and softirqs should be handled = at=0Aleast in the non-IRQ handler portion (they obviously must not = be=0Aprocessed in IRQ context). Since softirqs, other than in 4.1, = get=0Ahandled in a tasklet, we need to make sure we don't nest softirq=0Aex= ecution, which requires a new clone of process_pending_softirqs().=0A=0ASig= ned-off-by: Jan Beulich =0A=0A--- a/xen/common/keyhand= ler.c=0A+++ b/xen/common/keyhandler.c=0A@@ -375,16 +375,21 @@ static void = run_all_nonirq_keyhandlers(u=0A struct keyhandler *h;=0A int k;=0A = =0A- console_start_log_everything();=0A+ watchdog_disable();=0A+ = console_start_sync();=0A+=0A for ( k =3D 0; k < ARRAY_SIZE(key_table); = k++ )=0A {=0A+ process_pending_softirqs_nested();=0A h = =3D key_table[k];=0A if ( (h =3D=3D NULL) || !h->diagnostic || = h->irq_callback )=0A continue;=0A printk("[%c: %s]\n", = k, h->desc);=0A (*h->u.fn)(k);=0A }=0A- console_end_log_ever= ything();=0A+=0A+ console_end_sync();=0A+ watchdog_enable();=0A }=0A = =0A static DECLARE_TASKLET(run_all_keyhandlers_tasklet,=0A@@ -395,10 = +400,12 @@ static void run_all_keyhandlers(unsigned=0A struct = keyhandler *h;=0A int k;=0A =0A+ watchdog_disable();=0A+ = console_start_sync();=0A+=0A printk("'%c' pressed -> firing all = diagnostic keyhandlers\n", key);=0A =0A /* Fire all the IRQ-context = diangostic keyhandlers now */=0A- console_start_log_everything();=0A = for ( k =3D 0; k < ARRAY_SIZE(key_table); k++ )=0A {=0A h =3D = key_table[k];=0A@@ -407,7 +414,9 @@ static void run_all_keyhandlers(unsigne= d=0A printk("[%c: %s]\n", k, h->desc);=0A (*h->u.irq_fn)(k,= regs);=0A }=0A- console_end_log_everything();=0A+=0A+ console_en= d_sync();=0A+ watchdog_enable();=0A =0A /* Trigger the others from = a tasklet in non-IRQ context */=0A tasklet_schedule(&run_all_keyhandler= s_tasklet);=0A--- a/xen/common/softirq.c=0A+++ b/xen/common/softirq.c=0A@@ = -54,6 +54,16 @@ void process_pending_softirqs(void)=0A __do_softirq(1ul= <