[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v1] domctl: hold domctl lock while domain is destroyed


  • To: Dmitry Isaikin <isaikin-dmitry@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Sep 2021 14:30:39 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zlr36CY5+SAAvpoICBA0IsyuMWuU3ehiv1naH4j0+Ak=; b=cKqWtm3L4aTI+KAYNG89wgsO2oKyQdtOLqN3UZDaMcLoKwOF/nYrCM1iMj2bDzS31RUGTF4rsYBJ8mCElij7825Nu76ZH18+jiijWJTbeMmYBDgVwbC/WVt2sH5fTQ4cEsnzqGYQT8IiNUGLTU4wRG4qsxJnY4+kBVLTVxmY0EQCzXKV5K+iKP9W+VsgUS5Q4YzuLc3o/T7bs4vSwVFfX47ST4irKdR4Qtr7Et5CCoQz9yIBMoycB0J5pSuwM7DRsd4XD6Zyx21d4TGj1AVkurjCky0nPvDfWUHxmymBSpynt76WD47vs2tp6WsrEcILNPuLeysV/aUYtzDqxwZJ0Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gppEqpwIFCNAJIQALLqX/vmWmQxdVusccMFXayUiO/xQrwlEmQ25IkZXauFb6F95PRYoyjTCNKif169bFG/I2W/ul8E/aIKnd3SS56oJxyE7lTAMcykhJnC9pGFNnUootwOex7L4B0dmw5CZS2sVjesA2Q9/iiFWNo+x39pOiJ8j2ejDHKGAR9pPY3fuFbBN52PZwPsxbQ7DwP4KXs4yEUaNpW9k0cLq2MbLR9QeMoD+QKnCu00+iMyZosCOf0MKhtXSM1ldusA1IKRKTzUMh3Hvp+FL+hVkL/rYto7Jv1QAr94z2bioqzQLwl4w1JqmDoYGket4XuHmzmqMmUOvdw==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 16 Sep 2021 12:30:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16.09.2021 13:10, Dmitry Isaikin wrote:
> From: Dmitry Isaykin <isaikin-dmitry@xxxxxxxxx>
> 
> This significantly speeds up concurrent destruction of multiple domains on 
> x86.

This effectively is a simplistic revert of 228ab9992ffb ("domctl:
improve locking during domain destruction"). There it was found to
actually improve things; now you're claiming the opposite. It'll
take more justification, clearly identifying that you actually
revert an earlier change, and an explanation why then you don't
revert that change altogether. You will want to specifically also
consider the cleaning up of huge VMs, where use of the (global)
domctl lock may hamper progress of other (parallel) operations on
the system.

> I identify the place taking the most time:
> 
>     do_domctl(case XEN_DOMCTL_destroydomain)
>       -> domain_kill()
>            -> domain_relinquish_resources()
>                 -> relinquish_memory(d, &d->page_list, PGT_l4_page_table)
> 
> My reference setup: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.40GHz, Xen 4.14.
> 
> I use this command for test:
> 
>     for i in $(seq 1 5) ; do xl destroy test-vm-${i} & done
> 
> Without holding the lock all calls of `relinquish_memory(d, &d->page_list, 
> PGT_l4_page_table)`
> took on my setup (for HVM with 2GB of memory) about 3 seconds for each 
> destroying domain.
> 
> With holding the lock it took only 100 ms.

I'm further afraid I can't make the connection. Do you have an
explanation for why there would be such a massive difference?
What would prevent progress of relinquish_memory() with the
domctl lock not held?

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.