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

Re: [PATCH 3/7] xen/p2m: put reference for superpage


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 7 May 2024 13:30:37 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; 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=LLZe/krtQ6Xu4kVb/9R/+gGbvpxBggIpPorzOgR0Bhw=; b=XOQrsKwh4HDqJ/VDFegyTNH5S7w4NmmXaKaNjY/OZKnG5k5Q6zZMLtCfhmLwFcs9k5zP27riNA6WRUbw8n03iCAi4ztNc2j0saA2LZ75xzEug3TG5TFD1hZ/4WsngPSpJWzeFkwoS/3iyhDLHS7mztye29csmbMG+4xktIGaBfEEw+9SzlX8gQCOWpUs7DPrEejYINgKEIkpxSOLFIOsLQZlrQdxNxCxQ2asYgrb9iiMfkXfayWvCwsCyglQRFDrxe25eJ06ZyyAEOyD50BODXJiNGYgQLbiNo2EGf88X+Q7sq4a178Hwl1eiJnu/sYg+v1ZQZpvK2iVZiuhsNKncA==
  • 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=LLZe/krtQ6Xu4kVb/9R/+gGbvpxBggIpPorzOgR0Bhw=; b=ByY9qVFQu9/SPoA6ZeOdjVj2A8sHiuAm0UMhr3F33UiSpJkPGPxxn2gTpf1Nzmyr/oFpiCyMt6wBF28qAUUILAINPAvaV44iI6tdbboxtC1rJgCoOdGHHpUC1VOJHgwb3jhLIV1Aeq8zjR9mzW7jHnrNYS2ffpaJcwRaboiP5QQMYJQYEKgOQ3JcJ3uwUN2WVSXcj8UOvSqnKl9SUejMGyW6rnMtxq0KRxkxoOUX34hCBLRTCwz4WH3zTHkKegx6FXs6D89Yr4CWnsoZUOHh1EyaMC1ZwPOhjlo7h4kRnDmWXvEOyH2Eb2moCtFJmJ3NcVvjPOp0YDBUCiDtxsmd5A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=UZudkOKp+gbdyMRBFhSGCE/8einnKGQc8LRJmHQZAdr5Q+bAvJFbeoiHDIXmRvkgXhozvTBf97VYKxd8cJ4NRfx5eucUO5jg9h4J3DV1iZEbNQ1SCiJCCU8Kyti3UR0CGe5Ou2U+u98nwtzUX6jhbJ3Rl0Q29USncBFgdjgXUlJ8QDScPsk4fd2mWPQbyryt+K2vS4ECIouZCE22W8OrbEekB82r+AjdneOPlI66NqLq4vPqqxi/clBUN6GM+ZLeluKCKyJ7A+uLClIiSr5B1Wg0Z15Yd3kn4t++5FwIomEZAZpcJi1fZjxsSOeP/fIBbSZ7Hu7BkOpEdNDoVNtcpw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QRNt4g4A7VSxJO3WUpZf9rjoOFENpUE1By8lly6tBntEQm6suXdQG3LSr/EjS66p6+AEjo9pA8aYYkojVGi4qlPiaB5E878/GZtSTR4UWGY6HtO7b0hbgcKjfL9w1R4e2/p0nBTSvxA5IzfSEcsQSiiggWEf9D9Noprh024SQp1f4r0FPrRLc7H0pTl9Tg8STH/GnFGINH5qZ5zYmJ30xdpEzKcrfCgSpH9VVbTdI8aDpXczISnYdZJUC/YGbOSU6UiOOvqvdwrupq9F4Gt+tylXiHUjrZR4+FqNhmI+qQJs9tEgNhkH14T/XCw6FBaYJjHpbZbnjdhcgrHjoD+qdw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 07 May 2024 13:31:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHalVftK+2d6c8qh0SLUJVfhafWO7GL2AEAgAACwYA=
  • Thread-topic: [PATCH 3/7] xen/p2m: put reference for superpage

Hi Julien,

> On 7 May 2024, at 14:20, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Luca,
> 
> On 23/04/2024 09:25, Luca Fancellu wrote:
>> From: Penny Zheng <Penny.Zheng@xxxxxxx>
>> We are doing foreign memory mapping for static shared memory, and
>> there is a great possibility that it could be super mapped.
> 
> Is this because we are mapping more than one page at the time? Can you point 
> me to the code?

So, to be honest this patch was originally in Penny’s serie, my knowledge of 
this side of the codebase
is very limited and so I pushed this one basically untouched.

From what I can see in the serie the mappings are made in 
handle_shared_mem_bank, and map_regions_p2mt
is called for one page at the time (allocated through the function 
allocate_domheap_memory (new function introduced in
the serie).

So is that the case that this patch is not needed?


> 
>> But today, p2m_put_l3_page could not handle superpages.
> 
> This was done on purpose. Xen is not preemptible and therefore we need to be 
> cautious how much work is done within the p2m code.
> 
> With the below proposal, for 1GB mapping, we may end up to call put_page() up 
> to 512 * 512 = 262144 times. put_page() can free memory. This could be a very 
> long operation.
> 
> Have you benchmark how long it would take?

I did not, since its purpose was unclear to me and was not commented in the 
last serie from Penny.

Cheers,
Luca


 


Rackspace

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