[PATCH] powerpc/drmem: cache LMBs in xarray to accelerate lookup
Scott Cheloha
cheloha at linux.ibm.com
Wed Feb 5 03:19:04 AEDT 2020
On Tue, Jan 28, 2020 at 05:56:55PM -0600, Nathan Lynch wrote:
> 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.
I would like to try to "solve one problem at a time".
We can fix the linear search performance scaling problems without
removing the array of LMBs. As I've shown in my diff, we can do it
with minimal change to the existing code.
If it turns out that the PAPR guarantees the ordering of the memory
DRCs then in a subsequent patch (series) we can replace the LMB array
(__drmem_info.lmbs) with an xarray indexed by DRC and use e.g.
xa_for_each() in the hotplug code.
More information about the Linuxppc-dev
mailing list