
On Tue, Feb 14, 2023 at 09:38:13PM +0800, Ying-Chun Liu (PaulLiu) wrote:
From: Marc Zyngier maz@kernel.org
In the add_map() function, for each level it populates, it iterates from the root of the PT tree, making it ineficient if a mapping needs to occur past level 1.
Instead, replace it with a recursive (and much simpler) algorithm that keeps the complexity as low as possible. With this, mapping 512GB at level 2 goes from several seconds down to not measurable on an A55 machine.
We keep the block mappings at level 1 for now though.
Signed-off-by: Marc Zyngier maz@kernel.org Signed-off-by: Pierre-Clément Tosi ptosi@google.com [ Paul: pick from the Android tree. Fixup Pierre's commit. Rebase to the upstream ] Signed-off-by: Ying-Chun Liu (PaulLiu) paul.liu@linaro.org Cc: Tom Rini trini@konsulko.com Link: https://android.googlesource.com/platform/external/u-boot/+/96ad729cf4cab53b... Link: https://android.googlesource.com/platform/external/u-boot/+/6be9330601d81545...
Applied to u-boot/next, thanks!