[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 04/17] block/io_uring: implements interfaces
From: |
Julia Suvorova |
Subject: |
Re: [Qemu-devel] [PATCH v9 04/17] block/io_uring: implements interfaces for io_uring |
Date: |
Wed, 7 Aug 2019 13:35:04 +0200 |
On Fri, Aug 2, 2019 at 1:41 AM Aarushi Mehta <address@hidden> wrote:
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d6de200453..be688fcd5e 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2530,6 +2530,13 @@ F: block/file-posix.c
> F: block/file-win32.c
> F: block/win32-aio.c
>
> +Linux io_uring
> +M: Aarushi Mehta <address@hidden>
> +R: Stefan Hajnoczi <address@hidden>
s/address@hidden/address@hidden
> diff --git a/block/io_uring.c b/block/io_uring.c
> new file mode 100644
> index 0000000000..902b106954
> --- /dev/null
> +++ b/block/io_uring.c
> @@ -0,0 +1,409 @@
> +/*
> + * Linux io_uring support.
> + *
> + * Copyright (C) 2009 IBM, Corp.
> + * Copyright (C) 2009 Red Hat, Inc.
> + * Copyright (C) 2019 Aarushi Mehta
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#include "qemu/osdep.h"
> +#include <liburing.h>
> +#include "qemu-common.h"
> +#include "block/aio.h"
> +#include "qemu/queue.h"
> +#include "block/block.h"
> +#include "block/raw-aio.h"
> +#include "qemu/coroutine.h"
> +#include "qapi/error.h"
> +
> +#define MAX_EVENTS 128
This is called 'entries' in the liburing documentation, so MAX_ENTRIES
will be a better choice.
> +typedef struct LuringState {
> + AioContext *aio_context;
> +
> + struct io_uring ring;
> +
> + /* io queue for submit at batch. Protected by AioContext lock. */
> + LuringQueue io_q;
> +
> + /* I/O completion processing. Only runs in I/O thread. */
> + QEMUBH *completion_bh;
> +} LuringState;
> +
> +/**
> + * ioq_submit:
> + * @s: AIO state
> + *
> + * Queues pending sqes and submits them
> + *
> + */
> +static int ioq_submit(LuringState *s);
Now you can remove this declaration by moving the function before
luring_process_completions_and_submit()
> +LuringState *luring_init(Error **errp)
> +{
> + int rc;
> + LuringState *s;
> + s = g_new0(LuringState, 1);
> + struct io_uring *ring = &s->ring;
Please rewrite it with declarations at the beginning of the block.
Best regards, Julia Suvorova.
- [Qemu-devel] [PATCH v9 00/17] Add support for io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 01/17] configure: permit use of io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 02/17] qapi/block-core: add option for io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 03/17] block/block: add BDRV flag for io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 04/17] block/io_uring: implements interfaces for io_uring, Aarushi Mehta, 2019/08/01
- Re: [Qemu-devel] [PATCH v9 04/17] block/io_uring: implements interfaces for io_uring,
Julia Suvorova <=
- [Qemu-devel] [PATCH v9 05/17] stubs: add stubs for io_uring interface, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 06/17] util/async: add aio interfaces for io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 07/17] blockdev: adds bdrv_parse_aio to use io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 08/17] block/file-posix.c: extend to use io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 09/17] block: add trace events for io_uring, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 10/17] block/io_uring: adds userspace completion polling, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 11/17] qemu-io: adds option to use aio engine, Aarushi Mehta, 2019/08/01