From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH 4/4] xen: use idle vcpus to scrub pages Date: Wed, 18 Jun 2014 11:42:25 +0100 Message-ID: <53A17B2102000078000B6994@mail.emea.novell.com> References: <1403005783-30746-1-git-send-email-bob.liu@oracle.com> <1403005783-30746-4-git-send-email-bob.liu@oracle.com> <53A0583B020000780001B0E0@mail.emea.novell.com> <53A0E8CE.7050304@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WxDK1-0007hK-2n for xen-devel@lists.xenproject.org; Wed, 18 Jun 2014 10:42:29 +0000 In-Reply-To: <53A0E8CE.7050304@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: bob.liu@oracle.com Cc: lliubbo@gmail.com, keir@xen.org, ian.campbell@citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> Bob Liu 06/18/14 3:18 AM >>> >On 06/17/2014 09:01 PM, Jan Beulich wrote: >>>>> On 17.06.14 at 13:49, wrote: >>> --- a/xen/common/domain.c >>> +++ b/xen/common/domain.c >>> @@ -587,12 +587,14 @@ int domain_kill(struct domain *d) >>> d->tmem_client = NULL; >>> /* fallthrough */ >>> case DOMDYING_dying: >>> + enable_idle_scrub = 0; >>> rc = domain_relinquish_resources(d); >>> if ( rc != 0 ) >>> { >>> BUG_ON(rc != -EAGAIN); >>> break; >>> } >>> + enable_idle_scrub = 1; >>> for_each_vcpu ( d, v ) >>> unmap_vcpu_info(v); >>> d->is_dying = DOMDYING_dead; >> >> ??? > >enable_idle_scrub is a rough way to disable idle vcpu scrubbing, so that >domain_relinquish_resources() can get "&heap_lock" faster and make xl >destroy return quickly. If such a hack is really necessary, it requires a decent code comment. But I don't think it's needed, as long as you keep down the lock holding time on the scrubber side. Jan