From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Lalancette Subject: [PATCH]: Only start one xenfb kthread Date: Thu, 03 Dec 2009 12:48:47 +0100 Message-ID: <4B17A59F.7040301@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010406060302030902090509" 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 Cc: john.haxby@oracle.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010406060302030902090509 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit All, 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 --------------010406060302030902090509 Content-Type: text/plain; name="linux-2.6.18-xen.hg-fbfront-one-kthread.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linux-2.6.18-xen.hg-fbfront-one-kthread.patch" 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)) { --------------010406060302030902090509 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------010406060302030902090509--