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-devel

[Xen-devel] [PATCH 1/6] Make kernel threads freezable

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/6] Make kernel threads freezable
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Tue, 6 Feb 2007 16:13:50 +0800
Delivery-date: Tue, 06 Feb 2007 00:13:39 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcdJxrsC4+UDDWtYScSnuv4PyBroqg==
Thread-topic: [PATCH 1/6] Make kernel threads freezable
Make kthreads freezable. Two exceptions are xenbus and
xenwatch threads, which are required later at xenbus_
suspend(). Since we know them two nothing to do with
physical devices, mark them nofreeze safely.

Signed-off-by Ke Yu <ke.yu@xxxxxxxxx>
Signed-off-by Kevin Tian <kevin.tian@xxxxxxxxx>

diff -r a26a063eabd0 -r eeff197b56e4
linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Mon Feb
05 16:57:35 2007 +0800
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c        Mon Feb
05 16:57:58 2007 +0800
@@ -208,6 +208,9 @@ int blkif_schedule(void *arg)
                printk(KERN_DEBUG "%s: started\n", current->comm);
 
        while (!kthread_should_stop()) {
+               if(try_to_freeze())
+                       continue;
+            
                wait_event_interruptible(
                        blkif->wq,
                        blkif->waiting_reqs || kthread_should_stop());
diff -r a26a063eabd0 -r eeff197b56e4
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Mon Feb
05 16:57:35 2007 +0800
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Mon Feb
05 16:57:58 2007 +0800
@@ -717,6 +717,7 @@ static int xenwatch_thread(void *unused)
        struct list_head *ent;
        struct xs_stored_msg *msg;
 
+       current->flags |= PF_NOFREEZE;
        for (;;) {
                wait_event_interruptible(watch_events_waitq,
                                         !list_empty(&watch_events));
@@ -813,6 +814,7 @@ static int xenbus_thread(void *unused)
 {
        int err;
 
+       current->flags |= PF_NOFREEZE;
        for (;;) {
                err = process_msg();
                if (err)

Attachment: make_kthread_freeze_aware.patch
Description: make_kthread_freeze_aware.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 1/6] Make kernel threads freezable, Tian, Kevin <=