1
The following changes since commit 6157b0e19721aadb4c7fdcfe57b2924af6144b14:
1
The following changes since commit 3521ade3510eb5cefb2e27a101667f25dad89935:
2
2
3
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-=
3
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-07-29' into staging (2021-07-29 13:17:20 +0100)
4
request' into staging (2021-03-14 17:47:49 +0000)
5
4
6
are available in the Git repository at:
5
are available in the Git repository at:
7
6
8
https://gitlab.com/stefanha/qemu.git tags/block-pull-request
7
https://gitlab.com/stefanha/qemu.git tags/block-pull-request
9
8
10
for you to fetch changes up to fb0b154c801e3447e505de420195fb7038695941:
9
for you to fetch changes up to cc8eecd7f105a1dff5876adeb238a14696061a4a:
11
10
12
virtio-blk: Respect discard granularity (2021-03-15 09:48:53 +0000)
11
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver (2021-07-29 17:17:34 +0100)
13
12
14
----------------------------------------------------------------
13
----------------------------------------------------------------
15
Pull request
14
Pull request
16
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
17
----------------------------------------------------------------
22
----------------------------------------------------------------
18
23
19
Akihiko Odaki (1):
24
Fabian Ebner (1):
20
virtio-blk: Respect discard granularity
25
block/io_uring: resubmit when result is -EAGAIN
21
26
22
include/hw/virtio/virtio-blk.h | 1 +
27
Philippe Mathieu-Daudé (1):
23
hw/block/virtio-blk.c | 8 +++++++-
28
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver
24
hw/core/machine.c | 1 +
25
3 files changed, 9 insertions(+), 1 deletion(-)
26
29
27
--=20
30
Stefano Garzarella (1):
28
2.29.2
31
MAINTAINERS: add Stefano Garzarella as io_uring reviewer
29
32
33
MAINTAINERS | 2 ++
34
block/io_uring.c | 16 +++++++++++++++-
35
2 files changed, 17 insertions(+), 1 deletion(-)
36
37
--
38
2.31.1
39
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: Akihiko Odaki <akihiko.odaki@gmail.com>
1
From: Fabian Ebner <f.ebner@proxmox.com>
2
2
3
Report the configured granularity for discard operation to the
3
Linux SCSI can throw spurious -EAGAIN in some corner cases in its
4
guest. If this is not set use the block size.
4
completion path, which will end up being the result in the completed
5
io_uring request.
5
6
6
Since until now we have ignored the configured discard granularity
7
Resubmitting such requests should allow block jobs to complete, even
7
and always reported the block size, let's add
8
if such spurious errors are encountered.
8
'report-discard-granularity' property and disable it for older
9
machine types to avoid migration issues.
10
9
11
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
10
Co-authored-by: Stefan Hajnoczi <stefanha@gmail.com>
12
Reviewed-by: Stefano Garzarella <sgarzare@redhat.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
13
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
14
Message-Id: <20210225001239.47046-1-akihiko.odaki@gmail.com>
15
---
15
---
16
include/hw/virtio/virtio-blk.h | 1 +
16
block/io_uring.c | 16 +++++++++++++++-
17
hw/block/virtio-blk.c | 8 +++++++-
17
1 file changed, 15 insertions(+), 1 deletion(-)
18
hw/core/machine.c | 1 +
19
3 files changed, 9 insertions(+), 1 deletion(-)
20
18
21
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
19
diff --git a/block/io_uring.c b/block/io_uring.c
22
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
23
--- a/include/hw/virtio/virtio-blk.h
21
--- a/block/io_uring.c
24
+++ b/include/hw/virtio/virtio-blk.h
22
+++ b/block/io_uring.c
25
@@ -XXX,XX +XXX,XX @@ struct VirtIOBlkConf
23
@@ -XXX,XX +XXX,XX @@ static void luring_process_completions(LuringState *s)
26
uint16_t num_queues;
24
total_bytes = ret + luringcb->total_read;
27
uint16_t queue_size;
25
28
bool seg_max_adjust;
26
if (ret < 0) {
29
+ bool report_discard_granularity;
27
- if (ret == -EINTR) {
30
uint32_t max_discard_sectors;
28
+ /*
31
uint32_t max_write_zeroes_sectors;
29
+ * Only writev/readv/fsync requests on regular files or host block
32
bool x_enable_wce_if_config_wce;
30
+ * devices are submitted. Therefore -EAGAIN is not expected but it's
33
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
31
+ * known to happen sometimes with Linux SCSI. Submit again and hope
34
index XXXXXXX..XXXXXXX 100644
32
+ * the request completes successfully.
35
--- a/hw/block/virtio-blk.c
33
+ *
36
+++ b/hw/block/virtio-blk.c
34
+ * For more information, see:
37
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
35
+ * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u
38
blkcfg.wce = blk_enable_write_cache(s->blk);
36
+ *
39
virtio_stw_p(vdev, &blkcfg.num_queues, s->conf.num_queues);
37
+ * If the code is changed to submit other types of requests in the
40
if (virtio_has_feature(s->host_features, VIRTIO_BLK_F_DISCARD)) {
38
+ * future, then this workaround may need to be extended to deal with
41
+ uint32_t discard_granularity = conf->discard_granularity;
39
+ * genuine -EAGAIN results that should not be resubmitted
42
+ if (discard_granularity == -1 || !s->conf.report_discard_granularity) {
40
+ * immediately.
43
+ discard_granularity = blk_size;
41
+ */
44
+ }
42
+ if (ret == -EINTR || ret == -EAGAIN) {
45
virtio_stl_p(vdev, &blkcfg.max_discard_sectors,
43
luring_resubmit(s, luringcb);
46
s->conf.max_discard_sectors);
44
continue;
47
virtio_stl_p(vdev, &blkcfg.discard_sector_alignment,
45
}
48
- blk_size >> BDRV_SECTOR_BITS);
49
+ discard_granularity >> BDRV_SECTOR_BITS);
50
/*
51
* We support only one segment per request since multiple segments
52
* are not widely used and there are no userspace APIs that allow
53
@@ -XXX,XX +XXX,XX @@ static Property virtio_blk_properties[] = {
54
IOThread *),
55
DEFINE_PROP_BIT64("discard", VirtIOBlock, host_features,
56
VIRTIO_BLK_F_DISCARD, true),
57
+ DEFINE_PROP_BOOL("report-discard-granularity", VirtIOBlock,
58
+ conf.report_discard_granularity, true),
59
DEFINE_PROP_BIT64("write-zeroes", VirtIOBlock, host_features,
60
VIRTIO_BLK_F_WRITE_ZEROES, true),
61
DEFINE_PROP_UINT32("max-discard-sectors", VirtIOBlock,
62
diff --git a/hw/core/machine.c b/hw/core/machine.c
63
index XXXXXXX..XXXXXXX 100644
64
--- a/hw/core/machine.c
65
+++ b/hw/core/machine.c
66
@@ -XXX,XX +XXX,XX @@
67
GlobalProperty hw_compat_5_2[] = {
68
{ "ICH9-LPC", "smm-compat", "on"},
69
{ "PIIX4_PM", "smm-compat", "on"},
70
+ { "virtio-blk-device", "report-discard-granularity", "off" },
71
};
72
const size_t hw_compat_5_2_len = G_N_ELEMENTS(hw_compat_5_2);
73
74
--
46
--
75
2.29.2
47
2.31.1
76
48
diff view generated by jsdifflib
New patch
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
1
2
3
I'm interested in following the activity around the NVMe bdrv.
4
5
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
6
Message-id: 20210728183340.2018313-1-philmd@redhat.com
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8
---
9
MAINTAINERS | 1 +
10
1 file changed, 1 insertion(+)
11
12
diff --git a/MAINTAINERS b/MAINTAINERS
13
index XXXXXXX..XXXXXXX 100644
14
--- a/MAINTAINERS
15
+++ b/MAINTAINERS
16
@@ -XXX,XX +XXX,XX @@ F: block/null.c
17
NVMe Block Driver
18
M: Stefan Hajnoczi <stefanha@redhat.com>
19
R: Fam Zheng <fam@euphon.net>
20
+R: Philippe Mathieu-Daudé <philmd@redhat.com>
21
L: qemu-block@nongnu.org
22
S: Supported
23
F: block/nvme*
24
--
25
2.31.1
26
diff view generated by jsdifflib