From: Brendan Cully Subject: Re: [PATCH] Skip vcpu_hotplug for VCPU 0 in smp_resume Date: Tue, 31 Mar 2009 13:04:40 -0700 Message-ID: <20090331200440.GD70062@zanzibar.kublai.com> References: <20090331172423.GA70062@zanzibar.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="LZvS9be/3tNcYl/X" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "andy@cs.ubc.ca" , "xen-devel@lists.xensource.com" , kmansley@solarflare.com List-Id: xen-devel@lists.xenproject.org --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 31 March 2009 at 18:35, Keir Fraser wrote: > On 31/03/2009 18:24, "Brendan Cully" wrote: > > > The other is in the netfront accelerator. It tears down a xenstore > > watch on the accelerator path at every suspend, and adds the watch > > back on resume. As with any xenstore interaction, this can > > occasionally take a very long time. I'm going from faulty memory here, > > but I didn't think it was necessary to tear down and restore watches > > across suspend. Would it make sense to move the watch remove and add > > into the resume hook (taking it completely out of suspend and > > suspend_cancel)? > > They have to be renewed on full resume, but of course they do not get reset > across a cancelled suspend. Kieran may be able to advise on changing the net > accel code. Could it be as simple as this? I can't remember what happens if unregister_xenbus_watch is called after the xenbus connection has been reset. Should we just free the guest structures without interacting with xenstore at the start of the resume method? --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="netfront-xs.patch" # HG changeset patch # User Brendan Cully # Date 1238529727 25200 # Node ID 9db4499b35f048f4fac6323d8ca73de9779e6447 # Parent ed51e0ec7b8c08b1f191af7f89e53302f855f7d7 Only rebuild netfront accelerator xenstore watch on resume. The suspend_cancel function could take 2 seconds doing this. diff --git a/drivers/xen/netfront/accel.c b/drivers/xen/netfront/accel.c --- a/drivers/xen/netfront/accel.c +++ b/drivers/xen/netfront/accel.c @@ -678,8 +678,6 @@ unsigned long flags; int rc = 0; - netfront_accelerator_remove_watch(np); - mutex_lock(&accelerator_mutex); /* Check that we've got a device that was accelerated */ @@ -701,20 +699,6 @@ } -int netfront_accelerator_suspend_cancel(struct netfront_info *np, - struct xenbus_device *dev) -{ - /* - * Setting the watch will cause it to fire and probe the - * accelerator, so no need to call accelerator_probe_new_vif() - * directly here - */ - if (dev->state == XenbusStateConnected) - netfront_accelerator_add_watch(np); - return 0; -} - - void netfront_accelerator_resume(struct netfront_info *np, struct xenbus_device *dev) { @@ -722,6 +706,8 @@ spinlock_t *vif_states_lock; unsigned long flags; + netfront_accelerator_remove_watch(np); + mutex_lock(&accelerator_mutex); /* Check that we've got a device that was accelerated */ diff --git a/drivers/xen/netfront/netfront.c b/drivers/xen/netfront/netfront.c --- a/drivers/xen/netfront/netfront.c +++ b/drivers/xen/netfront/netfront.c @@ -311,13 +311,6 @@ } -static int netfront_suspend_cancel(struct xenbus_device *dev) -{ - struct netfront_info *info = dev->dev.driver_data; - return netfront_accelerator_suspend_cancel(info, dev); -} - - /** * We are reconnecting to the backend, due to a suspend/resume, or a backend * driver restart. We tear down our netif structure and recreate it, but @@ -2191,7 +2184,6 @@ .probe = netfront_probe, .remove = __devexit_p(netfront_remove), .suspend = netfront_suspend, - .suspend_cancel = netfront_suspend_cancel, .resume = netfront_resume, .otherend_changed = backend_changed, }; diff --git a/drivers/xen/netfront/netfront.h b/drivers/xen/netfront/netfront.h --- a/drivers/xen/netfront/netfront.h +++ b/drivers/xen/netfront/netfront.h @@ -249,9 +249,6 @@ int netfront_accelerator_suspend(struct netfront_info *np, struct xenbus_device *dev); extern -int netfront_accelerator_suspend_cancel(struct netfront_info *np, - struct xenbus_device *dev); -extern void netfront_accelerator_resume(struct netfront_info *np, struct xenbus_device *dev); extern --LZvS9be/3tNcYl/X 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 --LZvS9be/3tNcYl/X--