lkml.org 
[lkml]   [2023]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/3] memblock: Make finding index faster when modify regions.
From


在 2023/1/15 22:02, Mike Rapoport 写道:
> Hi,
>
> On Fri, Jan 13, 2023 at 04:26:58PM +0800, Peng Zhang wrote:
>> We can use binary search to find the index to modify regions in
>> memblock_add_range() and memblock_isolate_range(). Because the
>> arrangement of regions is ordered. It may be faster when there are
>> many regions. So implemented a binary search and a new macro to walk
>> regions.
>
> Did you see a measurable speedup with this optimization?
> I'm not in favor of micro-optimizations that complicate code.
>
Thank you for your reply. I haven't measured this patch yet,
theoretically this small optimization might be difficult to observe.
If you think this patch complicates the code, you can ignore this patch.

These three patches are independent and they can be applied
independently. The logic of the third patch is very simple. It will not
complicate the code. It is tested by the default configuration of qemu.
The total number of iterations of memblock_merge_regions() in the third
patch is reduced from more than one thousand to more than one hundred,
this is only in the case of a small number of regions. Can you consider
the third patch?

Sincerely yours,
Peng.

\
 
 \ /
  Last update: 2023-03-26 23:42    [W:0.067 / U:2.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site