Re: [PATCH] drivers/base/memory: Avoid overhead from for_each_present_section_nr()
From: Oscar Salvador
Date: Thu Apr 10 2025 - 09:57:39 EST
On Thu, Apr 10, 2025 at 03:18:00PM +0200, David Hildenbrand wrote:
> Staring at the end result and the particularly long comment, are we now
> really any better than before 61659efdb35c?
I think we are.
I mean, we made it slightly worse with 61659efdb35c because of what I
explained in the error report, but I think this version is faster than
the code before 61659efdb35c, as before that the outter loop was
incremented by 1 any given time, meaning that the section we were passing
to add_boot_memory_block() could have been already checked in there for
memory-blocks spanning multiple sections.
All in all, I think we are better, and the code is slightly simpler?
--
Oscar Salvador
SUSE Labs