[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 15/17] block/nvme: Use per-queue AIO context
From: |
Stefan Hajnoczi |
Subject: |
Re: [RFC PATCH 15/17] block/nvme: Use per-queue AIO context |
Date: |
Fri, 26 Jun 2020 13:59:33 +0100 |
On Thu, Jun 25, 2020 at 08:48:36PM +0200, Philippe Mathieu-Daudé wrote:
> To be able to use multiple queues on the same hardware,
> we need to have each queue able to receive IRQ notifications
> in the correct AIO context.
> The context has to be proper to each queue, not to the block
> driver. Move aio_context from BDRVNVMeState to NVMeQueuePair.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> RFC because I'm not familiar with AIO context
To keep things simple I suggest only doing Step 1 in this patch series.
Step 1:
The existing irq_notifier handler re-enters the request coroutine from a
BH scheduled in the BlockDriverState's AioContext. It doesn't matter
where the irq_notifier is handled, the completions will run in their
respective BlockDriverState AioContexts. This means that two
BlockDriverStates with different AioContexts sharing a single hardware
state will work correctly with just a single hardware queue. Therefore
multiqueue support is not required to support multiple BDSes with
different AioContexts.
Step 2:
Better performance can be achieved by creating multiple hardware
queuepairs, each with its own irq_notifier. During request submission a
int queue_idx_from_aio_context(AioContext *ctx) mapping function selects
a hardware queue. Hopefully that hardware queue's irq_notifier is
handled in the same Aiocontext for best performance, but there might be
cases where there are more BDS AioContexts than nvme hw queues.
Step 3:
When the QEMU block layer has multiqueue support then we'll no longer
map the BlockDriverState AioContext to a queue index but instead use
qemu_get_current_aio_context(). At this point a single BDS can process
I/O in multiple AioContexts and hardware queuepairs.
signature.asc
Description: PGP signature
- [PATCH 12/17] block/nvme: Simplify nvme_kick trace event, (continued)
- [PATCH 12/17] block/nvme: Simplify nvme_kick trace event, Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 13/17] block/nvme: Simplify completion trace events, Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 14/17] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE, Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 16/17] block/nvme: Check BDRVNVMeState::plugged out of nvme_kick(), Philippe Mathieu-Daudé, 2020/06/25
- [RFC PATCH 15/17] block/nvme: Use per-queue AIO context, Philippe Mathieu-Daudé, 2020/06/25
- [PATCH 17/17] block/nvme: Check BDRVNVMeState::plugged out of nvme_process_completion, Philippe Mathieu-Daudé, 2020/06/25
- Re: [PATCH 00/17] block/nvme: Various cleanups required to use multiple queues, no-reply, 2020/06/25