From: Tim Deegan Subject: Re: [PATCH for-4.6] x86/mm: Make {hap, shadow}_teardown() preemptible Date: Wed, 5 Aug 2015 15:26:26 +0100 Message-ID: <20150805142626.GC91350@deinos.phlegethon.org> References: <1438778160-6479-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1438778160-6479-1-git-send-email-andrew.cooper3@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: Andrew Cooper Cc: George Dunlap , Anshul Makkar , Wei Liu , Jan Beulich , Xen-devel List-Id: xen-devel@lists.xenproject.org Hi, At 13:36 +0100 on 05 Aug (1438781760), Andrew Cooper wrote: > From: Anshul Makkar > > A domain with sufficient shadow allocation can cause a watchdog timeout > during domain destruction. Expand the existing -ERESTART logic in > paging_teardown() to allow {hap/sh}_set_allocation() to become > restartable during the DOMCTL_destroydomain hypercall. > > Signed-off-by: Anshul Makkar > Signed-off-by: Andrew Cooper Good catch, thanks. > @@ -3139,7 +3139,9 @@ void shadow_teardown(struct domain *d) > d->arch.paging.shadow.free_pages, > d->arch.paging.shadow.p2m_pages); > /* Destroy all the shadows and release memory to domheap */ > - sh_set_allocation(d, 0, NULL); > + sh_set_allocation(d, 0, preempted); > + if ( preempted && *preempted ) > + goto out; > /* Release the hash table back to xenheap */ > if (d->arch.paging.shadow.hash_table) > shadow_hash_teardown(d); If the debug printout just above this is ever enabled, it will get very loud since the printout will make preemption likely. Please just delete the SHADOW_PRINTK above; you can also delete the one below if you like. The HAP side looks like it needs the same adjustment. With that done, Reviewed-by: Tim Deegan Cheers, Tim.