WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Move magic sysrq from workqueue to softirq context so th

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Move magic sysrq from workqueue to softirq context so that its more likely to work if the system is in a bad state.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Wed, 18 May 2005 21:41:38 +0000
Delivery-date: Thu, 19 May 2005 15:08:05 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1872, 2005/05/18 22:41:38+01:00, iap10@xxxxxxxxxxxxxxxxxxxxx

        Move magic sysrq from workqueue to softirq context so that its more 
likely to work if the system is in a bad state. 



 reboot.c |   30 +++++++++++-------------------
 1 files changed, 11 insertions(+), 19 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c 
b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c  2005-05-19 11:08:46 
-04:00
+++ b/linux-2.6.11-xen-sparse/arch/xen/kernel/reboot.c  2005-05-19 11:08:46 
-04:00
@@ -52,7 +52,6 @@
 
 /* Ignore multiple shutdown requests. */
 static int shutting_down = -1;
-static int pending_sysrq = -1;
 
 static void __do_suspend(void)
 {
@@ -216,36 +215,29 @@
     }
 }
 
-static void __sysrq_handler(void *unused)
+static void shutdown_handler(ctrl_msg_t *msg, unsigned long id)
 {
+    static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
+
+    if ( msg->subtype == CMSG_SHUTDOWN_SYSRQ )
+    {
+       int sysrq = ((shutdown_sysrq_t *)&msg->msg[0])->key;
+       
 #ifdef CONFIG_MAGIC_SYSRQ
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-    handle_sysrq(pending_sysrq, NULL, NULL);
+       handle_sysrq(sysrq, NULL, NULL);
 #else
-    handle_sysrq(pending_sysrq, NULL, NULL, NULL);
+       handle_sysrq(sysrq, NULL, NULL, NULL);
 #endif
 #endif
-    pending_sysrq = -1;
-}
-
-static void shutdown_handler(ctrl_msg_t *msg, unsigned long id)
-{
-    static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
-    static DECLARE_WORK(sysrq_work, __sysrq_handler, NULL);
-
-    if ( (shutting_down == -1) &&
+    }
+    else if ( (shutting_down == -1) &&
          ((msg->subtype == CMSG_SHUTDOWN_POWEROFF) ||
           (msg->subtype == CMSG_SHUTDOWN_REBOOT) ||
           (msg->subtype == CMSG_SHUTDOWN_SUSPEND)) )
     {
         shutting_down = msg->subtype;
         schedule_work(&shutdown_work);
-    }
-    else if ( (pending_sysrq == -1) && 
-              (msg->subtype == CMSG_SHUTDOWN_SYSRQ) )
-    {
-        pending_sysrq = ((shutdown_sysrq_t *)&msg->msg[0])->key;
-        schedule_work(&sysrq_work);
     }
     else
     {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>