1 | The following changes since commit 8048082f7a11040a366942a2de8abb4c3d0020c9: | 1 | The following changes since commit 6c769690ac845fa62642a5f93b4e4bd906adab95: |
---|---|---|---|
2 | 2 | ||
3 | Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-11-15-1' into staging (2017-11-16 11:34:24 +0000) | 3 | Merge remote-tracking branch 'remotes/vsementsov/tags/pull-simplebench-2021-05-04' into staging (2021-05-21 12:02:34 +0100) |
4 | 4 | ||
5 | are available in the git repository at: | 5 | are available in the Git repository at: |
6 | 6 | ||
7 | git://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 341e0b5658681f46680024cdbfc998717d85cc35: | 9 | for you to fetch changes up to 0a6f0c76a030710780ce10d6347a70f098024d21: |
10 | 10 | ||
11 | throttle-groups: forget timer and schedule next TGM on detach (2017-11-16 14:12:57 +0000) | 11 | coroutine-sleep: introduce qemu_co_sleep (2021-05-21 18:22:33 +0100) |
12 | |||
13 | ---------------------------------------------------------------- | ||
14 | Pull request | ||
12 | 15 | ||
13 | ---------------------------------------------------------------- | 16 | ---------------------------------------------------------------- |
14 | 17 | ||
15 | ---------------------------------------------------------------- | 18 | Paolo Bonzini (6): |
19 | coroutine-sleep: use a stack-allocated timer | ||
20 | coroutine-sleep: disallow NULL QemuCoSleepState** argument | ||
21 | coroutine-sleep: allow qemu_co_sleep_wake that wakes nothing | ||
22 | coroutine-sleep: move timer out of QemuCoSleepState | ||
23 | coroutine-sleep: replace QemuCoSleepState pointer with struct in the | ||
24 | API | ||
25 | coroutine-sleep: introduce qemu_co_sleep | ||
16 | 26 | ||
17 | Stefan Hajnoczi (1): | 27 | Philippe Mathieu-Daudé (1): |
18 | throttle-groups: forget timer and schedule next TGM on detach | 28 | bitops.h: Improve find_xxx_bit() documentation |
19 | 29 | ||
20 | block/throttle-groups.c | 12 ++++++++++++ | 30 | Zenghui Yu (1): |
21 | 1 file changed, 12 insertions(+) | 31 | multi-process: Initialize variables declared with g_auto* |
32 | |||
33 | include/qemu/bitops.h | 15 ++++++-- | ||
34 | include/qemu/coroutine.h | 27 ++++++++----- | ||
35 | block/block-copy.c | 10 ++--- | ||
36 | block/nbd.c | 14 +++---- | ||
37 | hw/remote/memory.c | 5 +-- | ||
38 | hw/remote/proxy.c | 3 +- | ||
39 | util/qemu-coroutine-sleep.c | 75 +++++++++++++++++++------------------ | ||
40 | 7 files changed, 79 insertions(+), 70 deletions(-) | ||
22 | 41 | ||
23 | -- | 42 | -- |
24 | 2.13.6 | 43 | 2.31.1 |
25 | 44 | ||
26 | diff view generated by jsdifflib |
1 | tg->any_timer_armed[] must be cleared when detaching pending timers from | 1 | From: Zenghui Yu <yuzenghui@huawei.com> |
---|---|---|---|
2 | the AioContext. Failure to do so leads to hung I/O because it looks | ||
3 | like there are still timers pending when in fact they have been removed. | ||
4 | 2 | ||
5 | Other ThrottleGroupMembers might have requests pending too so it's | 3 | Quote docs/devel/style.rst (section "Automatic memory deallocation"): |
6 | necessary to schedule the next TGM so it can set a timer. | ||
7 | 4 | ||
8 | This patch fixes hung I/O when QEMU is launched with drives that are in | 5 | * Variables declared with g_auto* MUST always be initialized, |
9 | the same throttling group: | 6 | otherwise the cleanup function will use uninitialized stack memory |
10 | 7 | ||
11 | (guest)$ dd if=/dev/zero of=/dev/vdb oflag=direct bs=512 & | 8 | Initialize @name properly to get rid of the compilation error (using |
12 | (guest)$ dd if=/dev/zero of=/dev/vdc oflag=direct bs=512 & | 9 | gcc-7.3.0 on CentOS): |
13 | (qemu) stop | ||
14 | (qemu) cont | ||
15 | ...I/O is stuck... | ||
16 | 10 | ||
17 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 11 | ../hw/remote/proxy.c: In function 'pci_proxy_dev_realize': |
18 | Message-id: 20171116112150.27607-1-stefanha@redhat.com | 12 | /usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized] |
13 | g_free (*pp); | ||
14 | ^~~~~~~~~~~~ | ||
15 | ../hw/remote/proxy.c:350:30: note: 'name' was declared here | ||
16 | g_autofree char *name; | ||
17 | ^~~~ | ||
18 | |||
19 | Signed-off-by: Zenghui Yu <yuzenghui@huawei.com> | ||
20 | Reviewed-by: Jagannathan Raman <jag.raman@oracle.com> | ||
21 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
22 | Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> | ||
23 | Message-id: 20210312112143.1369-1-yuzenghui@huawei.com | ||
19 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 24 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
20 | --- | 25 | --- |
21 | block/throttle-groups.c | 12 ++++++++++++ | 26 | hw/remote/memory.c | 5 ++--- |
22 | 1 file changed, 12 insertions(+) | 27 | hw/remote/proxy.c | 3 +-- |
28 | 2 files changed, 3 insertions(+), 5 deletions(-) | ||
23 | 29 | ||
24 | diff --git a/block/throttle-groups.c b/block/throttle-groups.c | 30 | diff --git a/hw/remote/memory.c b/hw/remote/memory.c |
25 | index XXXXXXX..XXXXXXX 100644 | 31 | index XXXXXXX..XXXXXXX 100644 |
26 | --- a/block/throttle-groups.c | 32 | --- a/hw/remote/memory.c |
27 | +++ b/block/throttle-groups.c | 33 | +++ b/hw/remote/memory.c |
28 | @@ -XXX,XX +XXX,XX @@ void throttle_group_attach_aio_context(ThrottleGroupMember *tgm, | 34 | @@ -XXX,XX +XXX,XX @@ void remote_sysmem_reconfig(MPQemuMsg *msg, Error **errp) |
29 | 35 | ||
30 | void throttle_group_detach_aio_context(ThrottleGroupMember *tgm) | 36 | remote_sysmem_reset(); |
31 | { | 37 | |
32 | + ThrottleGroup *tg = container_of(tgm->throttle_state, ThrottleGroup, ts); | 38 | - for (region = 0; region < msg->num_fds; region++) { |
33 | ThrottleTimers *tt = &tgm->throttle_timers; | 39 | - g_autofree char *name; |
34 | + int i; | 40 | + for (region = 0; region < msg->num_fds; region++, suffix++) { |
35 | 41 | + g_autofree char *name = g_strdup_printf("remote-mem-%u", suffix); | |
36 | /* Requests must have been drained */ | 42 | subregion = g_new(MemoryRegion, 1); |
37 | assert(tgm->pending_reqs[0] == 0 && tgm->pending_reqs[1] == 0); | 43 | - name = g_strdup_printf("remote-mem-%u", suffix++); |
38 | assert(qemu_co_queue_empty(&tgm->throttled_reqs[0])); | 44 | memory_region_init_ram_from_fd(subregion, NULL, |
39 | assert(qemu_co_queue_empty(&tgm->throttled_reqs[1])); | 45 | name, sysmem_info->sizes[region], |
40 | 46 | true, msg->fds[region], | |
41 | + /* Kick off next ThrottleGroupMember, if necessary */ | 47 | diff --git a/hw/remote/proxy.c b/hw/remote/proxy.c |
42 | + qemu_mutex_lock(&tg->lock); | 48 | index XXXXXXX..XXXXXXX 100644 |
43 | + for (i = 0; i < 2; i++) { | 49 | --- a/hw/remote/proxy.c |
44 | + if (timer_pending(tt->timers[i])) { | 50 | +++ b/hw/remote/proxy.c |
45 | + tg->any_timer_armed[i] = false; | 51 | @@ -XXX,XX +XXX,XX @@ static void probe_pci_info(PCIDevice *dev, Error **errp) |
46 | + schedule_next_request(tgm, i); | 52 | PCI_BASE_ADDRESS_SPACE_IO : PCI_BASE_ADDRESS_SPACE_MEMORY; |
47 | + } | 53 | |
48 | + } | 54 | if (size) { |
49 | + qemu_mutex_unlock(&tg->lock); | 55 | - g_autofree char *name; |
50 | + | 56 | + g_autofree char *name = g_strdup_printf("bar-region-%d", i); |
51 | throttle_timers_detach_aio_context(tt); | 57 | pdev->region[i].dev = pdev; |
52 | tgm->aio_context = NULL; | 58 | pdev->region[i].present = true; |
53 | } | 59 | if (type == PCI_BASE_ADDRESS_SPACE_MEMORY) { |
60 | pdev->region[i].memory = true; | ||
61 | } | ||
62 | - name = g_strdup_printf("bar-region-%d", i); | ||
63 | memory_region_init_io(&pdev->region[i].mr, OBJECT(pdev), | ||
64 | &proxy_mr_ops, &pdev->region[i], | ||
65 | name, size); | ||
54 | -- | 66 | -- |
55 | 2.13.6 | 67 | 2.31.1 |
56 | 68 | ||
57 | diff view generated by jsdifflib |