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

Re: [PATCH 2/2] xen/heap: pass order to free_heap_pages() in heap init


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 28 Jun 2022 14:40:23 +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=armh.onmicrosoft.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=TBlHUe/V+FMT0djyj1W9U7/vBkn/oW7XVxqCJ9ZEEbM=; b=EyrA4J3iDFbLjVuc5lA9DW2r3ygnAfUNEyuN0qV13gbvT/0s6c1RtMjot4ZFrAyfGulrFVihOecWWehWoh0veXnaqA/1bxdbuRxawxUjr607k89BuhQadmIr0D0X76dkS3+8WvKOgHrqgTEjXemDhmtmdApSAHVQsWRNAUoAaC/9FOabIGYL0ZpPe6Lt3S4A70O+p/vxzBJQk9ObsTQPt/DFu6UgUz9QN/UrhcsY8gZcCpbHOPM3DZRfBjoTDLYs9orK+GCKOEDI9btxTdc29se2sRKBjchDagAt5TbOw/Vo4mRWJv/pkvX+0CaB/uGofEUD+WcUI8ZtW4cyvFh3eQ==
  • 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=TBlHUe/V+FMT0djyj1W9U7/vBkn/oW7XVxqCJ9ZEEbM=; b=bkCaDzLxQDp16YTYRGyLKuKOEjq/3L7e+TCHKbwuETYlP95OWoMdQKgQKWPDSzyCRydoAQyujZPirhXYKq5/gNyj9X67PaMF9rRhZvYNpmkMs+BzlLv7satLUl9MAJTnk7bdk+yNDUkz2mEPfEBFZXnujZ4oAswGHOBdzJiHn0zafoU8DrKdb16no3bQipLz+Bju9m9a6HpoLbM4xzLP4xZC16EcP9XcZ/52m+YDwK9Ku1mbI0/uv2lXcUy3agBLjAR+11/QVImeSmEzzAY5b7Eww69txgCKAaNpCNLZq4mS8ymL+GtqqWJ9BukfuTLaodwR70EMGTlWfDIfcNvd1A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=hRImLPVAmrzgA90gNPe0G6uZbF77B6qi5oi+d/4MgoqFrfD3k/tS+Alt3djW7xi/rGh589UgpFRf1YUuSVeEcbpUkPqzQZO5cQx3EhMFyw6I3WFl/F6rKw6m65lNbPHfHbGeyJyGtCT1iQyUp953IMjBkZU7xMorkMohObgIS5NCdCYMEshxKY1WElZ/Fs/c5diqJ9A8UTCsFmLvLTf8DDwIJhGhtu305c3mIxpJWbr7s4+K4ObI1TmG6T4RD5KUU5XWfSpwQ+AVzgx3zjJJzyWocnMI8p9kz/f1YXiNxLnDMsKMYX25Zp0TpMAWLeGIx1pqNzzvwy8fl9lCBLc56w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PwctJcqu/IHoCm7dJ0qTSJe/fk/oR3U+8ipLw8LhBMuNWnUggeHJUzk+spWKYrd0ztYHw/PI+vcV+DB7EtZUfHalphX+gmHbHyoMD+sM1sfZDECqnUpR+OlQ9XreqxxkebsD3lLLt00hiGDkly6sZSl2bw7YqTqZ5e/V1WKrWftRJ26+W1prWOToI66HpcnVpmnSA0816UqY3jB7YUVGZCTz2MUIH6FHt+o3abXDOF8n/w+sG5+96hndDjpuY7l8R/zofqX61tlLU7OQe6nnfDXz+RzS+2OIeviHYcSzZUFjH5sLqO99724UrQiR7FzkVV9IdJU7ROQ4hhuRY1hbGw==
  • 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>, Hongyan Xia <hongyxia@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>
  • Delivery-date: Tue, 28 Jun 2022 14:40:44 +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: AQHYe9tJexjmG0CeP0OUFEWOQtMOSq1lAkiA
  • Thread-topic: [PATCH 2/2] xen/heap: pass order to free_heap_pages() in heap init

Hi Julien,

> On 9 Jun 2022, at 09:30, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Hongyan Xia <hongyxia@xxxxxxxxxx>
> 
> The idea is to split the range into multiple aligned power-of-2 regions
> which only needs to call free_heap_pages() once each. We check the least
> significant set bit of the start address and use its bit index as the
> order of this increment. This makes sure that each increment is both
> power-of-2 and properly aligned, which can be safely passed to
> free_heap_pages(). Of course, the order also needs to be sanity checked
> against the upper bound and MAX_ORDER.
> 
> Testing on a nested environment on c5.metal with various amount
> of RAM. Time for end_boot_allocator() to complete:
>            Before         After
>    - 90GB: 1426 ms        166 ms
>    -  8GB:  124 ms         12 ms
>    -  4GB:   60 ms          6 ms


On a arm64 Neoverse N1 system with 32GB of Ram I have:
- 1180 ms before
- 63 ms after

and my internal tests are passing on arm64.

Great optimisation :-)

(I will do a full review of code the in a second step).

> 
> Signed-off-by: Hongyan Xia <hongyxia@xxxxxxxxxx>
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

Cheers
Bertrand




 


Rackspace

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