From patchwork Wed Jun 3 14:49:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 49475 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DF04220BE7 for ; Wed, 3 Jun 2015 14:49:45 +0000 (UTC) Received: by wibut5 with SMTP id ut5sf5996327wib.0 for ; Wed, 03 Jun 2015 07:49:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:reply-to:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:x-original-sender :x-original-authentication-results:mailing-list; bh=xFa8hfg/9/QDulMs27yIQ5XvmyHzKymMrQN+Ev1Wd4Y=; b=XeGrsHPSGJNWdsc0ShZ00mjSfTHDt1je/BM9MM1HdbV8md23U/WicNPsDjPTTs9NpQ hzCBnLbhwtJwC1UO48rpozapSkAOIZ27sX2jZ2sQQTmOoL0L3MR2yZ0bvE4CgdY6zNvx pUGLpCWphk3tgbNhF8mSoiGqMfPUOzy2VYv40lwWxiorXlWC+47LI3XyqoiTJaSsMSui tLNyuas/Y7ABQOjLFGAdzsMViYrzNPIuiA1K4h0mZP1Vd2l7L5MQmgj/J2qmY+J1Jg2x fy2GbMKtVY+VBp9u+cGTdbLB1nIAqPPZiOdQsvmRy0GRbsr/9xWpuWPnvwAC336HF8mU Fpyg== X-Gm-Message-State: ALoCoQkqZaTQrGTR5c3KNgI6koWEMCVg4F61jbWZWtv4OQAo1VssNudWA8wsAU0tqSG+QqXYviWw X-Received: by 10.180.84.70 with SMTP id w6mr21668882wiy.4.1433342985208; Wed, 03 Jun 2015 07:49:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls69133laj.72.gmail; Wed, 03 Jun 2015 07:49:45 -0700 (PDT) X-Received: by 10.112.53.226 with SMTP id e2mr27592529lbp.124.1433342984913; Wed, 03 Jun 2015 07:49:44 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id ld3si18212475lac.92.2015.06.03.07.49.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 07:49:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by labpy14 with SMTP id py14so10136101lab.0 for ; Wed, 03 Jun 2015 07:49:44 -0700 (PDT) X-Received: by 10.152.4.137 with SMTP id k9mr32015752lak.29.1433342984736; Wed, 03 Jun 2015 07:49:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3923138lbb; Wed, 3 Jun 2015 07:49:43 -0700 (PDT) X-Received: by 10.42.48.147 with SMTP id s19mr29342520icf.39.1433342983077; Wed, 03 Jun 2015 07:49:43 -0700 (PDT) Received: from lists.sourceforge.net (lists.sourceforge.net. [216.34.181.88]) by mx.google.com with ESMTPS id x21si16750238ioi.76.2015.06.03.07.49.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Jun 2015 07:49:43 -0700 (PDT) Received-SPF: pass (google.com: domain of edk2-devel-bounces@lists.sourceforge.net designates 216.34.181.88 as permitted sender) client-ip=216.34.181.88; Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z09z2-0003g5-No; Wed, 03 Jun 2015 14:49:32 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Z09z1-0003g0-Kk for edk2-devel@lists.sourceforge.net; Wed, 03 Jun 2015 14:49:31 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of linaro.org designates 209.85.212.179 as permitted sender) client-ip=209.85.212.179; envelope-from=ard.biesheuvel@linaro.org; helo=mail-wi0-f179.google.com; Received: from mail-wi0-f179.google.com ([209.85.212.179]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1Z09z0-0006Z6-4f for edk2-devel@lists.sourceforge.net; Wed, 03 Jun 2015 14:49:31 +0000 Received: by wiga1 with SMTP id a1so17169929wig.0 for ; Wed, 03 Jun 2015 07:49:24 -0700 (PDT) X-Received: by 10.194.238.193 with SMTP id vm1mr61966948wjc.57.1433342963995; Wed, 03 Jun 2015 07:49:23 -0700 (PDT) Received: from localhost.localdomain ([31.157.58.113]) by mx.google.com with ESMTPSA id u6sm1413664wja.40.2015.06.03.07.49.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Jun 2015 07:49:22 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.sourceforge.net, lersek@redhat.com Date: Wed, 3 Jun 2015 16:49:14 +0200 Message-Id: <1433342954-15072-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record X-Headers-End: 1Z09z0-0006Z6-4f Subject: [edk2] [PATCH] ArmVirtPkg: increase memory preallocations to reduce region count X-BeenThere: edk2-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list Reply-To: edk2-devel@lists.sourceforge.net List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.sourceforge.net X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This updates the sizes of the preallocated regions so that the number of distinct regions that exists is minimal at the time we exit boot services. For a typical run of the ArmVirtQemu platform, we get the following utilization numbers: Reserved : 4 Pages (16,384 Bytes) LoaderCode: 210 Pages (860,160 Bytes) LoaderData: 0 Pages (0 Bytes) BS_Code : 355 Pages (1,454,080 Bytes) BS_Data : 6,807 Pages (27,881,472 Bytes) RT_Code : 112 Pages (458,752 Bytes) RT_Data : 288 Pages (1,179,648 Bytes) ACPI_Recl : 32 Pages (131,072 Bytes) ACPI_NVS : 0 Pages (0 Bytes) MMIO : 16,385 Pages (67,112,960 Bytes) MMIO_Port : 0 Pages (0 Bytes) PalCode : 0 Pages (0 Bytes) Available : 123,264 Pages (504,889,344 Bytes) -------------- Total Memory: 511 MB (536,854,528 Bytes) Strangely enough, the allocation count of 20,000 pages for BS_Data does not result in those regions being merged. For BS_Code, RT_Code and RT_Data, the increased preallocation results in the following reduction in the number of regions. 0x000040000000-0x00004000ffff [Loader Data | | | | | |WB|WT|WC|UC] - 0x000040010000-0x0000b66bbfff [Conventional Memory| | | | | |WB|WT|WC|UC] - 0x0000b66bc000-0x0000b66d0fff [Loader Data | | | | | |WB|WT|WC|UC] - 0x0000b66d1000-0x0000b6f6bfff [Loader Code | | | | | |WB|WT|WC|UC] - 0x0000b6f6c000-0x0000b6f6ffff [Reserved | | | | | |WB|WT|WC|UC]* - 0x0000b6f70000-0x0000b6f8ffff [Runtime Code |RUN| | | | |WB|WT|WC|UC]* - 0x0000b6f90000-0x0000b6faffff [ACPI Reclaim Memory| | | | | |WB|WT|WC|UC]* - 0x0000b6fb0000-0x0000b6fcffff [Runtime Code |RUN| | | | |WB|WT|WC|UC]* - 0x0000b6fd0000-0x0000b701ffff [Runtime Data |RUN| | | | |WB|WT|WC|UC]* - 0x0000b7020000-0x0000b702ffff [Runtime Code |RUN| | | | |WB|WT|WC|UC]* - 0x0000b7030000-0x0000b70cffff [Runtime Data |RUN| | | | |WB|WT|WC|UC]* - 0x0000b70d0000-0x0000b70dffff [Runtime Code |RUN| | | | |WB|WT|WC|UC]* + 0x000040010000-0x0000b680bfff [Conventional Memory| | | | | |WB|WT|WC|UC] + 0x0000b680c000-0x0000b6820fff [Loader Data | | | | | |WB|WT|WC|UC] + 0x0000b6821000-0x0000b70bbfff [Loader Code | | | | | |WB|WT|WC|UC] + 0x0000b70bc000-0x0000b70bffff [Reserved | | | | | |WB|WT|WC|UC]* + 0x0000b70c0000-0x0000b70dffff [ACPI Reclaim Memory| | | | | |WB|WT|WC|UC]* 0x0000b70e0000-0x0000b9f87fff [Conventional Memory| | | | | |WB|WT|WC|UC] 0x0000b9f88000-0x0000bb921fff [Boot Data | | | | | |WB|WT|WC|UC] 0x0000bb922000-0x0000bb9bffff [Conventional Memory| | | | | |WB|WT|WC|UC] 0x0000bb9c0000-0x0000bbbb0fff [Boot Data | | | | | |WB|WT|WC|UC] 0x0000bbbb1000-0x0000bbbeffff [Conventional Memory| | | | | |WB|WT|WC|UC] 0x0000bbbf0000-0x0000bbf1ffff [Boot Data | | | | | |WB|WT|WC|UC] - 0x0000bbf20000-0x0000bedfffff [Conventional Memory| | | | | |WB|WT|WC|UC] - 0x0000bee00000-0x0000bf71ffff [Loader Data | | | | | |WB|WT|WC|UC] - 0x0000bf720000-0x0000bf7ccfff [Conventional Memory| | | | | |WB|WT|WC|UC] - 0x0000bf7cd000-0x0000bf92ffff [Boot Code | | | | | |WB|WT|WC|UC] - 0x0000bf930000-0x0000bf93ffff [Runtime Code |RUN| | | | |WB|WT|WC|UC]* - 0x0000bf940000-0x0000bf95ffff [Conventional Memory| | | | | |WB|WT|WC|UC] - 0x0000bf960000-0x0000bf97ffff [Runtime Data |RUN| | | | |WB|WT|WC|UC]* + 0x0000bbf20000-0x0000bebfffff [Conventional Memory| | | | | |WB|WT|WC|UC] + 0x0000bec00000-0x0000bf51ffff [Loader Data | | | | | |WB|WT|WC|UC] + 0x0000bf520000-0x0000bf65cfff [Conventional Memory| | | | | |WB|WT|WC|UC] + 0x0000bf65d000-0x0000bf7bffff [Boot Code | | | | | |WB|WT|WC|UC] + 0x0000bf7c0000-0x0000bf84ffff [Runtime Code |RUN| | | | |WB|WT|WC|UC]* + 0x0000bf850000-0x0000bf86ffff [Conventional Memory| | | | | |WB|WT|WC|UC] + 0x0000bf870000-0x0000bf97ffff [Runtime Data |RUN| | | | |WB|WT|WC|UC]* 0x0000bf980000-0x0000bf997fff [Conventional Memory| | | | | |WB|WT|WC|UC] 0x0000bf998000-0x0000bf99afff [Boot Data | | | | | |WB|WT|WC|UC] 0x0000bf99b000-0x0000bf9aefff [Conventional Memory| | | | | |WB|WT|WC|UC] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Signed-off-by: Javier Martinez Canillas Reviewed-by: Doug Anderson Signed-off-by: Kukjin Kim --- ArmVirtPkg/ArmVirt.dsc.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index fd20ff39a068..08fb18a0c11a 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -330,9 +330,9 @@ gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|50 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|20 - gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|400 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|300 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|150 + gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesCode|1000 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiBootServicesData|20000 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderCode|20 gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiLoaderData|0