[edk2-devel] [PATCH v2 10/10] ArmVirtPkg: disable list length checks in NOOPT and DEBUG builds
Philippe Mathieu-Daudé
philmd at redhat.com
Fri Jan 15 09:31:14 UTC 2021
On 1/13/21 9:54 AM, Laszlo Ersek wrote:
> 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 at arm.com>
> Cc: Julien Grall <julien at xen.org>
> Cc: Leif Lindholm <leif at nuviainc.com>
> Cc: Philippe Mathieu-Daudé <philmd at redhat.com>
> Cc: Sami Mujawar <sami.mujawar at arm.com>
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3152
> Signed-off-by: Laszlo Ersek <lersek at redhat.com>
> Acked-by: Ard Biesheuvel <ard.biesheuvel at arm.com>
> ---
>
> Notes:
> v2:
> - no changes
> - pick up Ard's A-b
>
> ArmVirtPkg/ArmVirt.dsc.inc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daude <philmd at redhat.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#70418): https://edk2.groups.io/g/devel/message/70418
Mute This Topic: https://groups.io/mt/79646588/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list