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

Re: [PATCH v3] mm/pdx: Add comments throughout the codebase for pdx


  • To: Alejandro Vallejo <alejandro.vallejo@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 13 Jul 2023 17:12:09 +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=m7GEpxG8plrcHkZLC6LAHA131sajozL3jMElLXf1qww=; b=kLwn/R085xqmNob4Y7zJKHRC6e+ZZ+M4Cn48k2EoHUCm9KlZiwdHR0ARksyh6DO57JXsKGNphMGxhDe1LbuILFlICTpNG5HguVpqeZ1ydE9YDs/t+p283uovDiJsrRJ2dQyNK73eP6VTknvsAzfDHODt4JkzPPRhAF7soFkg0zzeHDqNpyaguvb7c+ewZKFvx47rnUAECUWHOCMSX8yrfI4ntMvbOd9+Q1MA631t8Mp2KNU8NCD1rF0FJqsdc3gFGEFn0sWrkOU1tfCOoVgJfSAS/VjjP+UVKEXLLcGUkCPjcrDHoaTbN8WQxOuivexMMgtPGjh2Z+ojpoHwB4Nl1g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OCWJdIlf1DwTh1hvTDnce5o38nhPTLWbQxWV4oIfcdH0qL6Ka6n/RiJZT7cdcaCUv6j3BAD6vANIQoT3EBxWZv5ATCiDqkbJGNO7l0NwTBFWKZTpJiu0pvuAh4Mtx1qNJRjggCkndaST6/ADofm9EetyLeIdLtNmy5VgbbyVzy7r7DF+m3CgSXK70acuOCED7aUwDbS0aiFKAyl/P9gg5TsGbXqBFP/JElxr4CS/pmwzqReIwm5fOntUwfv6bqXfw1IEX6xFbTGyQ3qAoelrG9vR5miiBx+CTX0wXMjvp7Zf0odYcDcR9NFO+xMbtQGHiFLVxsjr4yIa/qXVrZGCvA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 13 Jul 2023 15:12:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2023 18:07, Alejandro Vallejo wrote:
> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -31,6 +31,17 @@
>   *   (i.e. all devices assigned to) a guest share a single DMA address space
>   *   and, by default, Xen will ensure dfn == pfn.
>   *
> + * pdx: Page InDeX
> + *   Indices into the frame table holding the per-page's book-keeping
> + *   metadata. A compression scheme may be used, so there's a possibly non
> + *   identity mapping between valid(mfn) <-> valid(pdx). See the comments
> + *   in pdx.c for an in-depth explanation of that mapping. This also has a
> + *   knock-on effect on the directmap, as "compressed" pfns have no
> + *   corresponding mapped frames.

Didn't you mean to keep the directmap part optional, which would call for
saying "may" here (twice)? Yet then ...

> --- a/xen/include/xen/pdx.h
> +++ b/xen/include/xen/pdx.h
> @@ -1,6 +1,73 @@
>  #ifndef __XEN_PDX_H__
>  #define __XEN_PDX_H__
>  
> +/*
> + * PDX (Page inDeX)
> + *
> + * This file deals with optimisations pertaining to frame table and
> + * directmap indexing, A pdx is an index into the frame table, which
> + * typically also means an index into the directmap[1]. However, having an
> + * identity relationship between mfn and pdx could waste copious amounts of
> + * memory in empty frame table entries and page tables. There are some
> + * techniques to bring memory wastage down.
> + *
> + * [1] Some ports apply further modifications to a pdx before indexing the
> + *     directmap. This doesn't change the fact that the same compression
> + *     present in the frame table is also present in the directmap
> + *     whenever said map is present.

.. you mention it here as non-optional as well. Didn't you tell me that
Arm doesn't use compressed indexes into the directmap?

Jan



 


Rackspace

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