Re: [PATCH v3] drivers/base/memory.c: cache blocks in radix tree to accelerate lookup

From: Nathan Lynch
Date: Thu Dec 19 2019 - 13:09:12 EST


Scott Cheloha <cheloha@xxxxxxxxxxxxxxxxxx> writes:

> Searching for a particular memory block by id is slow because each block
> device is kept in an unsorted linked list on the subsystem bus.
>
> Lookup is much faster if we cache the blocks in a radix tree. Memory
> subsystem initialization and hotplug/hotunplug is at least a little faster
> for any machine with more than ~100 blocks, and the speedup grows with
> the block count.
>
> Signed-off-by: Scott Cheloha <cheloha@xxxxxxxxxxxxxxxxxx>
> Acked-by: David Hildenbrand <david@xxxxxxxxxx>

Acked-by: Nathan Lynch <nathanl@xxxxxxxxxxxxx>

Thanks Scott.