qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v9 04/17] block/io_uring: implements interfaces


From: Julia Suvorova
Subject: Re: [Qemu-block] [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.



reply via email to

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