]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
xenfb: Only start one xenfb kthread
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Dec 2009 13:53:06 +0000 (13:53 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Dec 2009 13:53:06 +0000 (13:53 +0000)
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@redhat.com>
drivers/xen/fbfront/xenfb.c

index d6155a45bb3163110b11e01b7a43bb8082d3c5f4..ce2d87a7b18ec7edfa39e40d65bba84c665efdbd 100644 (file)
@@ -831,7 +831,7 @@ static void xenfb_backend_changed(struct xenbus_device *dev,
                                 "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)) {