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

From: Nathan Lynch <[email-masked]>
Date: Tue, 28 Jan 2020 17:56:55 -0600

Scott Cheloha <[email-masked]> 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.