From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io
Cc: "Ard Biesheuvel" <ard.biesheuvel@arm.com>,
"Julien Grall" <julien@xen.org>,
"Leif Lindholm" <leif@nuviainc.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Sami Mujawar" <sami.mujawar@arm.com>
Subject: [PATCH v2 10/10] ArmVirtPkg: disable list length checks in NOOPT and DEBUG builds
Date: Wed, 13 Jan 2021 09:54:53 +0100 [thread overview]
Message-ID: <20210113085453.10168-11-lersek@redhat.com> (raw)
In-Reply-To: <20210113085453.10168-1-lersek@redhat.com>
In NOOPT and DEBUG builds, if "PcdMaximumLinkedListLength" is nonzero,
then several LIST_ENTRY *node* APIs in BaseLib compare the *full* list
length against the PCD.
This turns the time complexity of node-level APIs from constant to linear,
and that of full-list manipulations from linear to quadratic.
(See some example OVMF numbers in the previous patch.)
Checking list lengths against an arbitrary maximum -- default value, and
current ArmVirtPkg setting: 1,000,000 -- seems useless even in NOOPT and
DEBUG builds, while the cost is significant; so set the PCD to 0.
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Julien Grall <julien@xen.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3152
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
---
Notes:
v2:
- no changes
- pick up Ard's A-b
ArmVirtPkg/ArmVirt.dsc.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index 9ec92930472d..d9abadbe708c 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -290,7 +290,7 @@ [PcdsFeatureFlag.AARCH64]
[PcdsFixedAtBuild.common]
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000
+ gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|0
gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout|10000000
gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320
--
2.19.1.3.g30247aa5d201
next prev parent reply other threads:[~2021-01-13 8:55 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 8:54 [PATCH v2 00/10] multiple packages: shell usability improvements Laszlo Ersek
2021-01-13 8:54 ` [PATCH v2 01/10] ShellPkg/Comp: add file buffering Laszlo Ersek
2021-01-13 18:42 ` Philippe Mathieu-Daudé
2021-01-13 8:54 ` [PATCH v2 02/10] OvmfPkg: raise PcdShellFileOperationSize to 128KB Laszlo Ersek
2021-01-15 9:34 ` Philippe Mathieu-Daudé
2021-01-15 10:09 ` Laszlo Ersek
2021-01-15 15:58 ` Philippe Mathieu-Daudé
2021-01-15 18:22 ` Laszlo Ersek
2021-01-13 8:54 ` [PATCH v2 03/10] ArmVirtPkg: " Laszlo Ersek
2021-01-15 15:59 ` Philippe Mathieu-Daudé
2021-01-15 19:03 ` [edk2-devel] " Laszlo Ersek
2021-01-13 8:54 ` [PATCH v2 04/10] EmulatorPkg: add OrderedCollectionLib class resolution Laszlo Ersek
2021-01-13 13:20 ` Philippe Mathieu-Daudé
2021-01-18 16:48 ` [edk2-devel] " Laszlo Ersek
2021-01-19 7:55 ` 回复: " gaoliming
2021-01-13 8:54 ` [PATCH v2 05/10] UefiPayloadPkg: " Laszlo Ersek
2021-01-13 13:20 ` Philippe Mathieu-Daudé
2021-01-18 16:48 ` [edk2-devel] " Laszlo Ersek
2021-01-19 4:29 ` Guo Dong
2021-01-13 8:54 ` [PATCH v2 06/10] ShellPkg/ShellCommandLib: add ShellSortFileList() Laszlo Ersek
2021-01-13 13:19 ` Philippe Mathieu-Daudé
2021-01-13 8:54 ` [PATCH v2 07/10] ShellPkg/Ls: sort output by FileName in non-SFO mode Laszlo Ersek
2021-01-13 13:15 ` Philippe Mathieu-Daudé
2021-01-13 8:54 ` [PATCH v2 08/10] ShellPkg/ShellProtocol: sort files by FullName in RemoveDupInFileList() Laszlo Ersek
2021-01-13 13:14 ` Philippe Mathieu-Daudé
2021-01-14 14:19 ` Laszlo Ersek
2021-01-13 8:54 ` [PATCH v2 09/10] OvmfPkg: disable list length checks in NOOPT and DEBUG builds Laszlo Ersek
2021-01-15 9:30 ` Philippe Mathieu-Daudé
2021-01-13 8:54 ` Laszlo Ersek [this message]
2021-01-15 9:31 ` [PATCH v2 10/10] ArmVirtPkg: " Philippe Mathieu-Daudé
2021-01-19 18:39 ` [edk2-devel] [PATCH v2 00/10] multiple packages: shell usability improvements Laszlo Ersek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210113085453.10168-11-lersek@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox