[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC v2 4/8] hw/block/nvme: try to deal with the iov/qsg duali
From: |
Keith Busch |
Subject: |
Re: [PATCH RFC v2 4/8] hw/block/nvme: try to deal with the iov/qsg duality |
Date: |
Tue, 9 Feb 2021 00:45:15 +0900 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
On Sun, Feb 07, 2021 at 10:49:36PM +0100, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
>
> Introduce NvmeSg and try to deal with that pesky qsg/iov duality that
> haunts all the memory-related functions.
>
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
> ---
> hw/block/nvme.h | 8 ++-
> hw/block/nvme.c | 171 ++++++++++++++++++++++++------------------------
> 2 files changed, 90 insertions(+), 89 deletions(-)
>
> diff --git a/hw/block/nvme.h b/hw/block/nvme.h
> index cb2b5175f1a1..0e4fbd6990ad 100644
> --- a/hw/block/nvme.h
> +++ b/hw/block/nvme.h
> @@ -29,6 +29,11 @@ typedef struct NvmeAsyncEvent {
> NvmeAerResult result;
> } NvmeAsyncEvent;
>
> +typedef struct NvmeSg {
> + QEMUSGList qsg;
> + QEMUIOVector iov;
> +} NvmeSg;
It's always one or the other, right? If so, this could be a 'union'
type, and then you'd just need an indicator field to say which type it
is. There may be a meaninful memory savings that way since we
potentially allocate thousands of these.
- [PATCH RFC v2 0/8] hw/block/nvme: metadata and end-to-end data protection support, Klaus Jensen, 2021/02/07
- [PATCH RFC v2 2/8] hw/block/nvme: remove block accounting for write zeroes, Klaus Jensen, 2021/02/07
- [PATCH RFC v2 1/8] hw/block/nvme: remove redundant len member in compare context, Klaus Jensen, 2021/02/07
- [PATCH RFC v2 3/8] hw/block/nvme: fix strerror printing, Klaus Jensen, 2021/02/07
- [PATCH RFC v2 4/8] hw/block/nvme: try to deal with the iov/qsg duality, Klaus Jensen, 2021/02/07
- Re: [PATCH RFC v2 4/8] hw/block/nvme: try to deal with the iov/qsg duality,
Keith Busch <=
- [PATCH RFC v2 5/8] hw/block/nvme: remove the req dependency in map functions, Klaus Jensen, 2021/02/07
- [PATCH RFC v2 8/8] hw/block/nvme: end-to-end data protection, Klaus Jensen, 2021/02/07
- [PATCH RFC v2 7/8] hw/block/nvme: add metadata support, Klaus Jensen, 2021/02/07
- [PATCH RFC v2 6/8] hw/block/nvme: refactor nvme_dma, Klaus Jensen, 2021/02/07