Re: [PATCH] powerpc/drmem: cache LMBs in xarray to accelerate lookup

From: Nathan Lynch
Date: Tue Jan 28 2020 - 18:57:09 EST


Scott Cheloha <cheloha@xxxxxxxxxxxxx> writes:
> LMB lookup is currently an O(n) linear search. This scales poorly when
> there are many LMBs.
>
> If we cache each LMB by both its base address and its DRC index
> in an xarray we can cut lookups to O(log n), greatly accelerating
> drmem initialization and memory hotplug.
>
> This patch introduces two xarrays of of LMBs and fills them during
> drmem initialization. The patch also adds two interfaces for LMB
> lookup.

Good but can you replace the array of LMBs altogether
(drmem_info->lmbs)? xarray allows iteration over the members if needed.