qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/7] block/nvme: switch to a NVMeRequest freelist


From: Sergio Lopez
Subject: Re: [PATCH 4/7] block/nvme: switch to a NVMeRequest freelist
Date: Mon, 25 May 2020 10:10:28 +0200

On Tue, May 19, 2020 at 06:11:35PM +0100, Stefan Hajnoczi wrote:
> There are three issues with the current NVMeRequest->busy field:
> 1. The busy field is accidentally accessed outside q->lock when request
>    submission fails.
> 2. Waiters on free_req_queue are not woken when a request is returned
>    early due to submission failure.
> 2. Finding a free request involves scanning all requests. This makes
>    request submission O(n^2).
> 
> Switch to an O(1) freelist that is always accessed under the lock.
> 
> Also differentiate between NVME_QUEUE_SIZE, the actual SQ/CQ size, and
> NVME_NUM_REQS, the number of usable requests. This makes the code
> simpler than using NVME_QUEUE_SIZE everywhere and having to keep in mind
> that one slot is reserved.
> 
> Signed-off-by: Stefan Hajnoczi <address@hidden>
> ---
>  block/nvme.c | 81 ++++++++++++++++++++++++++++++++++------------------
>  1 file changed, 54 insertions(+), 27 deletions(-)

Reviewed-by: Sergio Lopez <address@hidden>

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]