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

Nathan Lynch nathanl at linux.ibm.com
Wed Jan 29 10:56:55 AEDT 2020


Scott Cheloha <cheloha at linux.ibm.com> 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.


More information about the Linuxppc-dev mailing list