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/
Home Products Support Community News


[Xen-devel] [PATCH]: Only start one xenfb kthread

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH]: Only start one xenfb kthread
From: Chris Lalancette <clalance@xxxxxxxxxx>
Date: Thu, 03 Dec 2009 12:48:47 +0100
Cc: john.haxby@xxxxxxxxxx
Delivery-date: Thu, 03 Dec 2009 03:49:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4
     When doing save/restore testing with the linux-2.6.18-xen.hg tree,
it was discovered that every time a restore happened we would get a
new xenfb thread.  While the framebuffer continues to work, this is
an obvious resource leak.  The attached patch only starts up a new xenfb
thread the first time the backend connects, and continues to re-use that
in the future.  Jeremy's upstream LKML tree doesn't suffer from this
since it uses a completely different mechanism to do screen updates.
Original patch from John Haxby @ Oracle; slightly modified by me to apply
to the linux-2.6.18-xen.hg tree.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
diff --git a/drivers/xen/fbfront/xenfb.c b/drivers/xen/fbfront/xenfb.c
--- a/drivers/xen/fbfront/xenfb.c
+++ b/drivers/xen/fbfront/xenfb.c
@@ -831,7 +831,7 @@ static void xenfb_backend_changed(struct
                                 "request-update", "%d", &val) < 0)
                        val = 0;
-               if (val){
+               if (val && !info->kthread) {
                        info->kthread = kthread_run(xenfb_thread, info,
                                                    "xenfb thread");
                        if (IS_ERR(info->kthread)) {
Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH]: Only start one xenfb kthread, Chris Lalancette <=