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

Re: [PATCH v5 12/15] VT-d: replace all-contiguous page tables by superpage mappings


  • To: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Jun 2022 11:58:48 +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:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QzbKjmGi1yxR+GbC/efFDx//kj10EeSkNuSqnIx3GWQ=; b=Il7t00scpAWDIAqzAr8M7a38Ob2PVxGDMAn34XUwg9XkzIylhz2VCEOKM3zvQKONLMXx49JTVfeESqOzcZ3HzR3D6uNM/3mQ2//AZKn1EYN/Fdo/B69k8u3lPh7G1cSVG4/fvV5c4jfMVKd6ciKH6R6yABzz0Lx/G+pnALkMOsgbblMwL4AhLYtwe/3ST/idbbTd7H3shSAn57UEX5MlZMX52YwIn6an2QfbAgy7LXloeVaoEh9YqVhH+No0WGDqcXL/S9Bi0phtcr2naHiCQ0fnNIWvAo98fIvgKJf1kDyx12w+XOC/+8Z0ZQUiBOfT8WxJNL5kU4bbJpjebONxEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mgB0OvlBwyQ+b+YviM6e1/AplbAoc42kcu0iT4tzrrO+rXymyc7L8Jp7XO/sy0NwPDOEjFJIcyEUQQfpQDZqcTgNG/0CI6MQDw4hWFlXmJtSD7Yf1RnGP/bJP9yuMhggIel8Lto7mR3I5E1HeseahARwLFVqvNGQMyek7C/Pk4fYOz7IDni79+kUF0ytX+/FAVmBAxEZKxon0zqdZKf8MgasBGu3PlPdKeEO5GOwh7H3siaYyutlIZBkmqXg0IHtYgJ4E0sYiairTctvxMBvSysxah9E0x46zMB6ou8BMn+QPSzEW6cIqEAtRzbyuhKe23GzWNn2qvK9PlVpjzBW9g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Thu, 02 Jun 2022 09:58:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.06.2022 11:35, Roger Pau Monné wrote:
> On Fri, May 27, 2022 at 01:19:55PM +0200, Jan Beulich wrote:
>> When a page table ends up with all contiguous entries (including all
>> identical attributes), it can be replaced by a superpage entry at the
>> next higher level. The page table itself can then be scheduled for
>> freeing.
>>
>> The adjustment to LEVEL_MASK is merely to avoid leaving a latent trap
>> for whenever we (and obviously hardware) start supporting 512G mappings.
>>
>> Note that cache sync-ing is likely more strict than necessary. This is
>> both to be on the safe side as well as to maintain the pattern of all
>> updates of (potentially) live tables being accompanied by a flush (if so
>> needed).
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
> 
> Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks.

>> ---
>> Unlike the freeing of all-empty page tables, this causes quite a bit of
>> back and forth for PV domains, due to their mapping/unmapping of pages
>> when they get converted to/from being page tables. It may therefore be
>> worth considering to delay re-coalescing a little, to avoid doing so
>> when the superpage would otherwise get split again pretty soon. But I
>> think this would better be the subject of a separate change anyway.
>>
>> Of course this could also be helped by more "aware" kernel side
>> behavior: They could avoid immediately mapping freed page tables
>> writable again, in anticipation of re-using that same page for another
>> page table elsewhere.
> 
> Could we provide an option to select whether to use super-pages for
> IOMMU, so that PV domains could keep the previous behavior?

Hmm, I did (a while ago) consider adding a command line option, largely
to have something in case of problems, but here you're asking about a
per-domain setting. Possible, sure, but I have to admit I'm always
somewhat hesitant when it comes to changes requiring to touch the tool
stack in non-trivial ways (required besides a separate Dom0 control).

It's also not clear what granularity we'd want to allow control at:
Just yes/no, or also an upper bound on the page sizes permitted, or
even a map of (dis)allowed page sizes?

Finally, what would the behavior be for HVM guests using shared page
tables? Should the IOMMU option there also suppress CPU-side large
pages? Or should the IOMMU option, when not fulfillable with shared
page tables, lead to use of separate page tables (and an error if
shared page tables were explicitly requested)?

Jan




 


Rackspace

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