1 | The following changes since commit 58560ad254fbda71d4daa6622d71683190070ee2: | 1 | The following changes since commit 3521ade3510eb5cefb2e27a101667f25dad89935: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.2-20191024' into staging (2019-10-24 16:22:58 +0100) | 3 | Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-07-29' into staging (2021-07-29 13:17:20 +0100) |
4 | 4 | ||
5 | are available in the Git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | https://github.com/stefanha/qemu.git tags/block-pull-request | 7 | https://gitlab.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to d154ef37ff885918fa3e512fd7a8e42870291667: | 9 | for you to fetch changes up to cc8eecd7f105a1dff5876adeb238a14696061a4a: |
10 | 10 | ||
11 | yield_until_fd_readable: make it work with any AioContect (2019-10-25 14:38:29 +0200) | 11 | MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver (2021-07-29 17:17:34 +0100) |
12 | 12 | ||
13 | ---------------------------------------------------------------- | 13 | ---------------------------------------------------------------- |
14 | Pull request | 14 | Pull request |
15 | 15 | ||
16 | The main fix here is for io_uring. Spurious -EAGAIN errors can happen and the | ||
17 | request needs to be resubmitted. | ||
18 | |||
19 | The MAINTAINERS changes carry no risk and we might as well include them in QEMU | ||
20 | 6.1. | ||
21 | |||
16 | ---------------------------------------------------------------- | 22 | ---------------------------------------------------------------- |
17 | 23 | ||
18 | Dietmar Maurer (1): | 24 | Fabian Ebner (1): |
19 | yield_until_fd_readable: make it work with any AioContect | 25 | block/io_uring: resubmit when result is -EAGAIN |
20 | 26 | ||
21 | Julia Suvorova (1): | 27 | Philippe Mathieu-Daudé (1): |
22 | virtio-blk: Add blk_drain() to virtio_blk_device_unrealize() | 28 | MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver |
23 | 29 | ||
24 | hw/block/virtio-blk.c | 1 + | 30 | Stefano Garzarella (1): |
25 | util/qemu-coroutine-io.c | 7 +++++-- | 31 | MAINTAINERS: add Stefano Garzarella as io_uring reviewer |
26 | 2 files changed, 6 insertions(+), 2 deletions(-) | 32 | |
33 | MAINTAINERS | 2 ++ | ||
34 | block/io_uring.c | 16 +++++++++++++++- | ||
35 | 2 files changed, 17 insertions(+), 1 deletion(-) | ||
27 | 36 | ||
28 | -- | 37 | -- |
29 | 2.21.0 | 38 | 2.31.1 |
30 | 39 | ||
31 | diff view generated by jsdifflib |
New patch | |||
---|---|---|---|
1 | From: Stefano Garzarella <sgarzare@redhat.com> | ||
1 | 2 | ||
3 | I've been working with io_uring for a while so I'd like to help | ||
4 | with reviews. | ||
5 | |||
6 | Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> | ||
7 | Message-Id: <20210728131515.131045-1-sgarzare@redhat.com> | ||
8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
9 | --- | ||
10 | MAINTAINERS | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/MAINTAINERS b/MAINTAINERS | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/MAINTAINERS | ||
16 | +++ b/MAINTAINERS | ||
17 | @@ -XXX,XX +XXX,XX @@ Linux io_uring | ||
18 | M: Aarushi Mehta <mehta.aaru20@gmail.com> | ||
19 | M: Julia Suvorova <jusual@redhat.com> | ||
20 | M: Stefan Hajnoczi <stefanha@redhat.com> | ||
21 | +R: Stefano Garzarella <sgarzare@redhat.com> | ||
22 | L: qemu-block@nongnu.org | ||
23 | S: Maintained | ||
24 | F: block/io_uring.c | ||
25 | -- | ||
26 | 2.31.1 | ||
27 | diff view generated by jsdifflib |
1 | From: Dietmar Maurer <dietmar@proxmox.com> | 1 | From: Fabian Ebner <f.ebner@proxmox.com> |
---|---|---|---|
2 | 2 | ||
3 | Simply use qemu_get_current_aio_context(). | 3 | Linux SCSI can throw spurious -EAGAIN in some corner cases in its |
4 | completion path, which will end up being the result in the completed | ||
5 | io_uring request. | ||
4 | 6 | ||
5 | Signed-off-by: Dietmar Maurer <dietmar@proxmox.com> | 7 | Resubmitting such requests should allow block jobs to complete, even |
6 | Message-Id: <20191024045610.9071-1-dietmar@proxmox.com> | 8 | if such spurious errors are encountered. |
9 | |||
10 | Co-authored-by: Stefan Hajnoczi <stefanha@gmail.com> | ||
11 | Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> | ||
12 | Signed-off-by: Fabian Ebner <f.ebner@proxmox.com> | ||
13 | Message-id: 20210729091029.65369-1-f.ebner@proxmox.com | ||
7 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 14 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
8 | --- | 15 | --- |
9 | util/qemu-coroutine-io.c | 7 +++++-- | 16 | block/io_uring.c | 16 +++++++++++++++- |
10 | 1 file changed, 5 insertions(+), 2 deletions(-) | 17 | 1 file changed, 15 insertions(+), 1 deletion(-) |
11 | 18 | ||
12 | diff --git a/util/qemu-coroutine-io.c b/util/qemu-coroutine-io.c | 19 | diff --git a/block/io_uring.c b/block/io_uring.c |
13 | index XXXXXXX..XXXXXXX 100644 | 20 | index XXXXXXX..XXXXXXX 100644 |
14 | --- a/util/qemu-coroutine-io.c | 21 | --- a/block/io_uring.c |
15 | +++ b/util/qemu-coroutine-io.c | 22 | +++ b/block/io_uring.c |
16 | @@ -XXX,XX +XXX,XX @@ qemu_co_send_recv(int sockfd, void *buf, size_t bytes, bool do_send) | 23 | @@ -XXX,XX +XXX,XX @@ static void luring_process_completions(LuringState *s) |
17 | } | 24 | total_bytes = ret + luringcb->total_read; |
18 | 25 | ||
19 | typedef struct { | 26 | if (ret < 0) { |
20 | + AioContext *ctx; | 27 | - if (ret == -EINTR) { |
21 | Coroutine *co; | 28 | + /* |
22 | int fd; | 29 | + * Only writev/readv/fsync requests on regular files or host block |
23 | } FDYieldUntilData; | 30 | + * devices are submitted. Therefore -EAGAIN is not expected but it's |
24 | @@ -XXX,XX +XXX,XX @@ typedef struct { | 31 | + * known to happen sometimes with Linux SCSI. Submit again and hope |
25 | static void fd_coroutine_enter(void *opaque) | 32 | + * the request completes successfully. |
26 | { | 33 | + * |
27 | FDYieldUntilData *data = opaque; | 34 | + * For more information, see: |
28 | - qemu_set_fd_handler(data->fd, NULL, NULL, NULL); | 35 | + * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u |
29 | + aio_set_fd_handler(data->ctx, data->fd, false, NULL, NULL, NULL, NULL); | 36 | + * |
30 | qemu_coroutine_enter(data->co); | 37 | + * If the code is changed to submit other types of requests in the |
31 | } | 38 | + * future, then this workaround may need to be extended to deal with |
32 | 39 | + * genuine -EAGAIN results that should not be resubmitted | |
33 | @@ -XXX,XX +XXX,XX @@ void coroutine_fn yield_until_fd_readable(int fd) | 40 | + * immediately. |
34 | FDYieldUntilData data; | 41 | + */ |
35 | 42 | + if (ret == -EINTR || ret == -EAGAIN) { | |
36 | assert(qemu_in_coroutine()); | 43 | luring_resubmit(s, luringcb); |
37 | + data.ctx = qemu_get_current_aio_context(); | 44 | continue; |
38 | data.co = qemu_coroutine_self(); | 45 | } |
39 | data.fd = fd; | ||
40 | - qemu_set_fd_handler(fd, fd_coroutine_enter, NULL, &data); | ||
41 | + aio_set_fd_handler( | ||
42 | + data.ctx, fd, false, fd_coroutine_enter, NULL, NULL, &data); | ||
43 | qemu_coroutine_yield(); | ||
44 | } | ||
45 | -- | 46 | -- |
46 | 2.21.0 | 47 | 2.31.1 |
47 | 48 | ||
48 | diff view generated by jsdifflib |
1 | From: Julia Suvorova <jusual@redhat.com> | 1 | From: Philippe Mathieu-Daudé <philmd@redhat.com> |
---|---|---|---|
2 | 2 | ||
3 | QEMU does not wait for completed I/O requests, assuming that the guest | 3 | I'm interested in following the activity around the NVMe bdrv. |
4 | driver will reset the device before calling unrealize(). This does not | ||
5 | happen on Windows, and QEMU crashes in virtio_notify(), getting the | ||
6 | result of a completed I/O request on hot-unplugged device. | ||
7 | 4 | ||
8 | Signed-off-by: Julia Suvorova <jusual@redhat.com> | 5 | Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> |
9 | Message-Id: <20191018142856.31870-1-jusual@redhat.com> | 6 | Message-id: 20210728183340.2018313-1-philmd@redhat.com |
10 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 7 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
11 | --- | 8 | --- |
12 | hw/block/virtio-blk.c | 1 + | 9 | MAINTAINERS | 1 + |
13 | 1 file changed, 1 insertion(+) | 10 | 1 file changed, 1 insertion(+) |
14 | 11 | ||
15 | diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c | 12 | diff --git a/MAINTAINERS b/MAINTAINERS |
16 | index XXXXXXX..XXXXXXX 100644 | 13 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/hw/block/virtio-blk.c | 14 | --- a/MAINTAINERS |
18 | +++ b/hw/block/virtio-blk.c | 15 | +++ b/MAINTAINERS |
19 | @@ -XXX,XX +XXX,XX @@ static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp) | 16 | @@ -XXX,XX +XXX,XX @@ F: block/null.c |
20 | VirtIODevice *vdev = VIRTIO_DEVICE(dev); | 17 | NVMe Block Driver |
21 | VirtIOBlock *s = VIRTIO_BLK(dev); | 18 | M: Stefan Hajnoczi <stefanha@redhat.com> |
22 | 19 | R: Fam Zheng <fam@euphon.net> | |
23 | + blk_drain(s->blk); | 20 | +R: Philippe Mathieu-Daudé <philmd@redhat.com> |
24 | virtio_blk_data_plane_destroy(s->dataplane); | 21 | L: qemu-block@nongnu.org |
25 | s->dataplane = NULL; | 22 | S: Supported |
26 | qemu_del_vm_change_state_handler(s->change); | 23 | F: block/nvme* |
27 | -- | 24 | -- |
28 | 2.21.0 | 25 | 2.31.1 |
29 | 26 | ||
30 | diff view generated by jsdifflib |