[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] xen/arm: Skip loops in init_pdx() when no PDX compression is used
- To: Julien Grall <julien@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: "Orzel, Michal" <michal.orzel@xxxxxxx>
- Date: Mon, 14 Jul 2025 14:37:14 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=oi+oKlCdaAVR0zVjjBhze4WriwjNb6gEtgmaubLKlms=; b=B4gaNxot3TD09aNSLP0Mjj6rz1ndpJlw9I4n2CEGMTqHFzwknEa4C2BKDJGY7LHZiOss+EVajgoM1Qk7h1wwPS4yrwNXy9LGTw1IoOr0Hkf+rMsx2becQD6NP3v3ip9j+DwfhXOSVq1NYvBlZpuVd60O7X37tk/MSwVvo31NAF8RYeTZNFl+2trZ1sgyYu1YjOoUw6ng+B8WWci9qx0sJ/P6BvshA6yMAYfNBt0dP4utuzSOcWmXNNJn9gwMGES9RzUeEWk2q9Hm4kYjRY9MahvlyMgsBBOyJbbRajWZ+dDcQPSd11SKHHkHPqnkA/HNVi6NDIYV6z6X+ZBLa1/xTQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ehEQjltYynmys7W68ybdS3MS2x4d4J2xuzEKC5fyU08yFWHrWgzUuoKOk+L/4JjUv7qeKWz2omnp5+tBSNkl/U/qn9Z6d1CzO27WE66DlAJR7TIVfJbH+eVlvh4QtIFUMt4RepFWR/C5bbqYn4dthgeOKJRkYAxUYVX6m1SusyaoGX3+aHa0YusaPcQsMfupNPRc8JUd1ROzvSy2BJzFhfmrBd42AOcOl6gZMagyhMu0J2USyyGq4CdBWZFht2NH4S1pmB+fWC9z99gI/QLFqU+HTd1EyvSDAYCvd+Nngx37OrJsDwZHqkty9SDHS7Tz+OMvyj2Tfsu2KUJyo9voSw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Mon, 14 Jul 2025 12:37:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 14/07/2025 12:09, Julien Grall wrote:
> Hi Michal,
>
> On 14/07/2025 10:50, Orzel, Michal wrote:
>>
>>
>> On 14/07/2025 11:45, Julien Grall wrote:
>>> Hi Michal,
>>>
>>> On 14/07/2025 08:37, Orzel, Michal wrote:
>>>>
>>>>
>>>> On 12/07/2025 12:29, Julien Grall wrote:
>>>>> Hi Michal,
>>>>>
>>>>> On 04/07/2025 08:54, Michal Orzel wrote:
>>>>>> When CONFIG_PDX_COMPRESSION=n, pdx_init_mask(), pdx_region_mask() and
>>>>>> pfn_pdx_hole_setup() are just stubs doing nothing. It does not make
>>>>>> sense to keep the two loops iterating over all the memory banks.
>>>>>
>>>>> I saw this was already committed. But I have a question. Wouldn't the
>>>>> compiler be able to optimize and remove the loops? Asking because we are
>>>>> trying to limit the number of #ifdef in the code hence why we have stubs.
>>>> Before submitting a patch I did disassembled init_pdx() with and without my
>>>> patch and in the latter case the compiler did not optimize out the loops.
>>>
>>> One more question. Was this in debug or non-debug build?
>> It was in debug build.
>
> Ok. I would be interested to know if this change in non-debug build
> because we have quite a few places in Xen relying on code elimination.
I did a test and with -O2 (non-debug), the loops are removed as oppose to -O1
(debug). That said, -fdce is part of -O1, so it's difficult to say what option
made impact here.
~Michal
|