From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Lagerwall Subject: Re: [PATCH] xen/manage: Always freeze/thaw processes when suspend/resuming Date: Fri, 22 Aug 2014 15:39:09 +0100 Message-ID: <53F7560D.50004@citrix.com> References: <1408354896-30770-1-git-send-email-ross.lagerwall@citrix.com> <53F722E9.4060505@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XKpzn-0000nx-8o for xen-devel@lists.xenproject.org; Fri, 22 Aug 2014 14:39:15 +0000 In-Reply-To: <53F722E9.4060505@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel , xen-devel@lists.xenproject.org Cc: Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org On 08/22/2014 12:00 PM, David Vrabel wrote: > On 18/08/14 10:41, Ross Lagerwall wrote: >> Always freeze processes when suspending and thaw processes when resuming >> to prevent a race noticeable with HVM guests. >> >> This prevents a deadlock where the khubd kthread (which is designed to >> be freezable) acquires a usb device lock and then tries to allocate >> memory which requires the disk which hasn't been resumed yet. >> Meanwhile, the xenwatch thread deadlocks waiting for the usb device >> lock. >> >> Freezing processes fixes this because the khubd thread is only thawed >> after the xenwatch thread finishes resuming all the devices. > > I think this is the safest fix for this issue but I'm a bit concerned > about how much extra time the freeze_processes() call will add to the > suspend. > > Can you measure how long it takes for a typical VM? > With 2 vCPUs and 1024MB RAM, 8ms for freeze_processes() and 6ms for thaw_processes(). With 4 vCPUs and 4096MB RAM, 8ms for freeze_processes() and 5ms for thaw_processes(). With 4 vCPUs and 4096MB RAM running stress -c 4, 12ms for freeze_processes() and 66ms for thaw_processes(). It doesn't seem to take too long... Cheers -- Ross Lagerwall