[PATCH] nvme-core: use xarray for cel storing
Christoph Hellwig
hch at lst.de
Wed Sep 23 01:07:25 EDT 2020
On Tue, Sep 22, 2020 at 02:05:29PM -0700, Chaitanya Kulkarni wrote:
> When using linked list we have to open code the locking, search, and
> destroy operations with the loops even if data structure doesn't fall
> into the fast path.
>
> One of the main advantage of having XArray to store, search, and remove
> items is that it handles all the locking by itself, avoids the loops
> when using linked lists, provides clear API to replace the linked list's
> search and destroy loops.
>
> This patch replaces the ctrl->cel list with XArray and removes :-
>
> a. Extra code needed for the linked list for ctrl->cel item management
> such as nvme_find_cel().
> b. Destroy loop in the nvme_free_ctrl().
> c. Explicit insertion locking in the nvme_get_effects_log().
A nice, I thought of that I while ago but never got to it. This looks
exactly like what I had in mind.
More information about the Linux-nvme
mailing list