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

Re: [PATCH 1/2] x86: Perform mem_sharing teardown before paging teardown


  • To: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 16 Feb 2023 09:31:24 +0100
  • 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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IxwyBi/6+06GlqNrP1Mmqf7cL5IXjJEd77QWsj/4MYY=; b=Fq5tH6d/Q1c1jV+srS2LRdirrfqoFW9k03ou+jIIo+TwUJFpot+K17v/G4tKwodQlJ0T1LDGzmPX1PpoYuPJ0SZRKyl01L33hVYW4mGlNcGGK160l6vPddgJxW5OS+TcswKO96Og79Ep8bRfBnslMJMUA/k6XbUA+TporZetWQdWBoFO3DZ/olk0iSyvr9qGnaCYVAU0aMa+lwes6d7WUf8viam9w6aXQgZohakdQ7xjSa226g3d0kWU/amk0seVL/VRYTcX9vVFUORv8z2MrAyJ8FyHxra+ppyFuD83/sh8Dj24kMz4Ml77e24GLGt/KWSt5FHSN6wLbWOmpahJ3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gs51snOTBasR00t+ejmxsUeaYNnAlJ1GqArdy6itrFW6ujEm4+y+tIZ+DeofpjSIeyYdiB3HkmnskDXnnLgfL8qRWzCNqdGGMgxoJlgD4OmuwxTdQ95mrwfahjtFDUfy9KcXE6Vq0UuT+5O36aXXfvl5Y4l7OsAXRZnFk51W+K9rBRQBIKk6dMrfcgoMAshQUTV2yMVMi5jYFQgiLU8HzSjAbxDWkCGg/Pp2+dHv+UgsOaPuZkklifk9EuMiZVQmRlImhLPt72fizlNg+Xszus9V3WwgCDPwV7WQUPN6yQY//r/uJmR5wojkDVHhQm9hHGScF+tXVdtVweBPdlJJYg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 16 Feb 2023 08:32:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.02.2023 17:29, Tamas K Lengyel wrote:
> On Wed, Feb 15, 2023 at 5:27 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> Did you consider the alternative of adjusting the ASSERT() in question
>> instead? It could reasonably become
>>
>> #ifdef CONFIG_MEM_SHARING
>>     ASSERT(!p2m_is_hostp2m(p2m) || !remove_root ||
> !atomic_read(&d->shr_pages));
>> #endif
>>
>> now, I think. That would be less intrusive a change (helpful for
>> backporting), but there may be other (so far unnamed) benefits of pulling
>> ahead the shared memory teardown.
> 
> I have a hard time understanding this proposed ASSERT.

It accounts for the various ways p2m_teardown() can (now) be called,
limiting the actual check for no remaining shared pages to the last
of all these invocations (on the host p2m with remove_root=true).

Maybe

    /* Limit the check to the final invocation. */
    if ( p2m_is_hostp2m(p2m) && remove_root )
        ASSERT(!atomic_read(&d->shr_pages));

would make this easier to follow? Another option might be to move
the assertion to paging_final_teardown(), ahead of that specific call
to p2m_teardown().

Jan



 


Rackspace

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