1 | The following changes since commit fb68096da3d35e64c88cd610c1fa42766c58e92a: | 1 | The following changes since commit 3f3bbfc7cef4490c5ed5550766a81e7d18f08db1: |
---|---|---|---|
2 | 2 | ||
3 | Revert "tests: use memfd in vhost-user-test" (2018-02-13 09:51:52 +0000) | 3 | Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-03-12' into staging (2019-03-12 21:06:26 +0000) |
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 | git://github.com/stefanha/qemu.git tags/block-pull-request |
8 | 8 | ||
9 | for you to fetch changes up to 64b01feca991e5b19a5d750ef77cdca92b68bdbb: | 9 | for you to fetch changes up to f357fcd890a8d6ced6d261338b859a41414561e9: |
10 | 10 | ||
11 | misc: fix spelling (2018-02-13 15:38:17 +0000) | 11 | file-posix: add drop-cache=on|off option (2019-03-13 10:54:55 +0000) |
12 | |||
13 | ---------------------------------------------------------------- | ||
14 | Pull request | ||
15 | |||
16 | * Add 'drop-cache=on|off' option to file-posix.c. The default is on. | ||
17 | Disabling the option fixes a QEMU 3.0.0 performance regression when live | ||
18 | migrating on the same host with cache.direct=off. | ||
12 | 19 | ||
13 | ---------------------------------------------------------------- | 20 | ---------------------------------------------------------------- |
14 | 21 | ||
15 | ---------------------------------------------------------------- | 22 | Stefan Hajnoczi (1): |
23 | file-posix: add drop-cache=on|off option | ||
16 | 24 | ||
17 | Fam Zheng (2): | 25 | qapi/block-core.json | 6 ++++++ |
18 | Add a git-publish configuration file | 26 | block/file-posix.c | 16 ++++++++++++++++ |
19 | README: Document 'git-publish' workflow | 27 | 2 files changed, 22 insertions(+) |
20 | |||
21 | Marc-André Lureau (1): | ||
22 | misc: fix spelling | ||
23 | |||
24 | Stefan Hajnoczi (1): | ||
25 | vl: pause vcpus before stopping iothreads | ||
26 | |||
27 | Wolfgang Bumiller (1): | ||
28 | ratelimit: don't align wait time with slices | ||
29 | |||
30 | include/qemu/ratelimit.h | 11 ++++----- | ||
31 | util/qemu-coroutine-lock.c | 2 +- | ||
32 | vl.c | 12 ++++++++-- | ||
33 | .gitpublish | 58 ++++++++++++++++++++++++++++++++++++++++++++++ | ||
34 | README | 31 ++++++++++++++++++++++++- | ||
35 | 5 files changed, 104 insertions(+), 10 deletions(-) | ||
36 | create mode 100644 .gitpublish | ||
37 | 28 | ||
38 | -- | 29 | -- |
39 | 2.14.3 | 30 | 2.20.1 |
40 | 31 | ||
41 | 32 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Fam Zheng <famz@redhat.com> | ||
2 | 1 | ||
3 | git-publish [1] is a convenient tool to send patches and has been | ||
4 | popular among QEMU developers. Recently it has been made available in | ||
5 | Fedora official repo thanks to Stefan's work. | ||
6 | |||
7 | One nice feature of the tool is a per-project configuration with | ||
8 | profiles, especially in which the cccmd option is a handy method to | ||
9 | create the Cc list. | ||
10 | |||
11 | [1]: https://github.com/stefanha/git-publish | ||
12 | |||
13 | Signed-off-by: Fam Zheng <famz@redhat.com> | ||
14 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
15 | Message-id: 20180205054725.25634-2-famz@redhat.com | ||
16 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
17 | --- | ||
18 | .gitpublish | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
19 | 1 file changed, 58 insertions(+) | ||
20 | create mode 100644 .gitpublish | ||
21 | |||
22 | diff --git a/.gitpublish b/.gitpublish | ||
23 | new file mode 100644 | ||
24 | index XXXXXXX..XXXXXXX | ||
25 | --- /dev/null | ||
26 | +++ b/.gitpublish | ||
27 | @@ -XXX,XX +XXX,XX @@ | ||
28 | +# | ||
29 | +# Common git-publish profiles that can be used to send patches to QEMU upstream. | ||
30 | +# | ||
31 | +# See https://github.com/stefanha/git-publish for more information | ||
32 | +# | ||
33 | +[gitpublishprofile "default"] | ||
34 | +base = master | ||
35 | +prefix = PATCH | ||
36 | +to = qemu-devel@nongnu.org | ||
37 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
38 | + | ||
39 | +[gitpublishprofile "rfc"] | ||
40 | +base = master | ||
41 | +prefix = RFC PATCH | ||
42 | +to = qemu-devel@nongnu.org | ||
43 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
44 | + | ||
45 | +[gitpublishprofile "stable"] | ||
46 | +base = master | ||
47 | +prefix = PATCH | ||
48 | +to = qemu-devel@nongnu.org | ||
49 | +cc = qemu-stable@nongnu.org | ||
50 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
51 | + | ||
52 | +[gitpublishprofile "trivial"] | ||
53 | +base = master | ||
54 | +prefix = PATCH | ||
55 | +to = qemu-devel@nongnu.org | ||
56 | +cc = qemu-trivial@nongnu.org | ||
57 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
58 | + | ||
59 | +[gitpublishprofile "block"] | ||
60 | +base = master | ||
61 | +prefix = PATCH | ||
62 | +to = qemu-devel@nongnu.org | ||
63 | +cc = qemu-block@nongnu.org | ||
64 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
65 | + | ||
66 | +[gitpublishprofile "arm"] | ||
67 | +base = master | ||
68 | +prefix = PATCH | ||
69 | +to = qemu-devel@nongnu.org | ||
70 | +cc = qemu-arm@nongnu.org | ||
71 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
72 | + | ||
73 | +[gitpublishprofile "s390"] | ||
74 | +base = master | ||
75 | +prefix = PATCH | ||
76 | +to = qemu-devel@nongnu.org | ||
77 | +cc = qemu-s390@nongnu.org | ||
78 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
79 | + | ||
80 | +[gitpublishprofile "ppc"] | ||
81 | +base = master | ||
82 | +prefix = PATCH | ||
83 | +to = qemu-devel@nongnu.org | ||
84 | +cc = qemu-ppc@nongnu.org | ||
85 | +cccmd = scripts/get_maintainer.pl --noroles --norolestats --nogit --nogit-fallback 2>/dev/null | ||
86 | -- | ||
87 | 2.14.3 | ||
88 | |||
89 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Fam Zheng <famz@redhat.com> | ||
2 | 1 | ||
3 | [Fixed s/git-profile/git-publish/ typo and s/for once/the first time/. | ||
4 | --Stefan] | ||
5 | |||
6 | Signed-off-by: Fam Zheng <famz@redhat.com> | ||
7 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
8 | Message-id: 20180205054725.25634-3-famz@redhat.com | ||
9 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
10 | --- | ||
11 | README | 31 ++++++++++++++++++++++++++++++- | ||
12 | 1 file changed, 30 insertions(+), 1 deletion(-) | ||
13 | |||
14 | diff --git a/README b/README | ||
15 | index XXXXXXX..XXXXXXX 100644 | ||
16 | --- a/README | ||
17 | +++ b/README | ||
18 | @@ -XXX,XX +XXX,XX @@ The QEMU source code is maintained under the GIT version control system. | ||
19 | |||
20 | git clone git://git.qemu.org/qemu.git | ||
21 | |||
22 | -When submitting patches, the preferred approach is to use 'git | ||
23 | +When submitting patches, one common approach is to use 'git | ||
24 | format-patch' and/or 'git send-email' to format & send the mail to the | ||
25 | qemu-devel@nongnu.org mailing list. All patches submitted must contain | ||
26 | a 'Signed-off-by' line from the author. Patches should follow the | ||
27 | guidelines set out in the HACKING and CODING_STYLE files. | ||
28 | |||
29 | +A 'git-publish' utility was created to make above process less | ||
30 | +cumbersome, and is highly recommended for making regular contributions, | ||
31 | +or even just for sending consecutive patch series revisions. It also | ||
32 | +requires a working 'git send-email' setup, and by default doesn't | ||
33 | +automate everything, so you may want to go through the above steps | ||
34 | +manually the first time. | ||
35 | + | ||
36 | +For installation instructions, please go to | ||
37 | + | ||
38 | + https://github.com/stefanha/git-publish | ||
39 | + | ||
40 | +The workflow with 'git-publish' is: | ||
41 | + | ||
42 | + $ git checkout master -b my-feature | ||
43 | + $ # work on new commits, add your 'Signed-off-by' lines to each | ||
44 | + $ git publish | ||
45 | + | ||
46 | +Your patch series will be sent and tagged as my-feature-v1 if you need to refer | ||
47 | +back to it in the future. | ||
48 | + | ||
49 | +Sending v2: | ||
50 | + | ||
51 | + $ git checkout my-feature # same topic branch | ||
52 | + $ # making changes to the commits (using 'git rebase', for example) | ||
53 | + $ git publish | ||
54 | + | ||
55 | +Your patch series will be sent with 'v2' tag in the subject and the git tip | ||
56 | +will be tagged as my-feature-v2. | ||
57 | + | ||
58 | Additional information on submitting patches can be found online via | ||
59 | the QEMU website | ||
60 | |||
61 | -- | ||
62 | 2.14.3 | ||
63 | |||
64 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | Commit dce8921b2baaf95974af8176406881872067adfa ("iothread: Stop threads | ||
2 | before main() quits") introduced iothread_stop_all() to avoid the | ||
3 | following virtio-scsi assertion failure: | ||
4 | 1 | ||
5 | assert(blk_get_aio_context(d->conf.blk) == s->ctx); | ||
6 | |||
7 | Back then the assertion failed because when bdrv_close_all() made | ||
8 | d->conf.blk NULL, blk_get_aio_context() returned the global AioContext | ||
9 | instead of s->ctx. | ||
10 | |||
11 | The same assertion can still fail today when vcpus submit new I/O | ||
12 | requests after iothread_stop_all() has moved the BDS to the global | ||
13 | AioContext. | ||
14 | |||
15 | This patch hardens the iothread_stop_all() approach by pausing vcpus | ||
16 | before calling iothread_stop_all(). | ||
17 | |||
18 | Note that the assertion failure is a race condition. It is not possible | ||
19 | to reproduce it reliably. | ||
20 | |||
21 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
22 | Message-id: 20180201110708.8080-1-stefanha@redhat.com | ||
23 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
24 | --- | ||
25 | vl.c | 12 ++++++++++-- | ||
26 | 1 file changed, 10 insertions(+), 2 deletions(-) | ||
27 | |||
28 | diff --git a/vl.c b/vl.c | ||
29 | index XXXXXXX..XXXXXXX 100644 | ||
30 | --- a/vl.c | ||
31 | +++ b/vl.c | ||
32 | @@ -XXX,XX +XXX,XX @@ int main(int argc, char **argv, char **envp) | ||
33 | |||
34 | main_loop(); | ||
35 | replay_disable_events(); | ||
36 | + | ||
37 | + /* The ordering of the following is delicate. Stop vcpus to prevent new | ||
38 | + * I/O requests being queued by the guest. Then stop IOThreads (this | ||
39 | + * includes a drain operation and completes all request processing). At | ||
40 | + * this point emulated devices are still associated with their IOThreads | ||
41 | + * (if any) but no longer have any work to do. Only then can we close | ||
42 | + * block devices safely because we know there is no more I/O coming. | ||
43 | + */ | ||
44 | + pause_all_vcpus(); | ||
45 | iothread_stop_all(); | ||
46 | - | ||
47 | - pause_all_vcpus(); | ||
48 | bdrv_close_all(); | ||
49 | + | ||
50 | res_free(); | ||
51 | |||
52 | /* vhost-user must be cleaned up before chardevs. */ | ||
53 | -- | ||
54 | 2.14.3 | ||
55 | |||
56 | diff view generated by jsdifflib |
1 | From: Wolfgang Bumiller <w.bumiller@proxmox.com> | 1 | Commit dd577a26ff03b6829721b1ffbbf9e7c411b72378 ("block/file-posix: |
---|---|---|---|
2 | implement bdrv_co_invalidate_cache() on Linux") introduced page cache | ||
3 | invalidation so that cache.direct=off live migration is safe on Linux. | ||
2 | 4 | ||
3 | It is possible for rate limited writes to keep overshooting a slice's | 5 | The invalidation takes a significant amount of time when the file is |
4 | quota by a tiny amount causing the slice-aligned waiting period to | 6 | large and present in the page cache. Normally this is not the case for |
5 | effectively halve the rate. | 7 | cross-host live migration but it can happen when migrating between QEMU |
8 | processes on the same host. | ||
6 | 9 | ||
7 | Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com> | 10 | On same-host migration we don't need to invalidate pages for correctness |
8 | Reviewed-by: Alberto Garcia <berto@igalia.com> | 11 | anyway, so an option to skip page cache invalidation is useful. I |
9 | Message-id: 20180207071758.6818-1-w.bumiller@proxmox.com | 12 | investigated optimizing invalidation and detecting same-host migration, |
13 | but both are hard to achieve so a user-visible option will suffice. | ||
14 | |||
15 | As a bonus this option means that the cache invalidation feature will | ||
16 | now be detectable by libvirt via QMP schema introspection. | ||
17 | |||
18 | Suggested-by: Neil Skrypuch <neil@tembosocial.com> | ||
19 | Tested-by: Neil Skrypuch <neil@tembosocial.com> | ||
20 | Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> | ||
21 | Reviewed-by: Eric Blake <eblake@redhat.com> | ||
22 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
23 | Message-id: 20190307164941.3322-1-stefanha@redhat.com | ||
24 | Message-Id: <20190307164941.3322-1-stefanha@redhat.com> | ||
10 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | 25 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
11 | --- | 26 | --- |
12 | include/qemu/ratelimit.h | 11 +++++------ | 27 | qapi/block-core.json | 6 ++++++ |
13 | 1 file changed, 5 insertions(+), 6 deletions(-) | 28 | block/file-posix.c | 16 ++++++++++++++++ |
29 | 2 files changed, 22 insertions(+) | ||
14 | 30 | ||
15 | diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h | 31 | diff --git a/qapi/block-core.json b/qapi/block-core.json |
16 | index XXXXXXX..XXXXXXX 100644 | 32 | index XXXXXXX..XXXXXXX 100644 |
17 | --- a/include/qemu/ratelimit.h | 33 | --- a/qapi/block-core.json |
18 | +++ b/include/qemu/ratelimit.h | 34 | +++ b/qapi/block-core.json |
19 | @@ -XXX,XX +XXX,XX @@ typedef struct { | 35 | @@ -XXX,XX +XXX,XX @@ |
20 | static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n) | 36 | # @locking: whether to enable file locking. If set to 'auto', only enable |
21 | { | 37 | # when Open File Descriptor (OFD) locking API is available |
22 | int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); | 38 | # (default: auto, since 2.10) |
23 | - uint64_t delay_slices; | 39 | +# @drop-cache: invalidate page cache during live migration. This prevents |
24 | + double delay_slices; | 40 | +# stale data on the migration destination with cache.direct=off. |
25 | 41 | +# Currently only supported on Linux hosts. | |
26 | assert(limit->slice_quota && limit->slice_ns); | 42 | +# (default: on, since: 4.0) |
27 | 43 | # @x-check-cache-dropped: whether to check that page cache was dropped on live | |
28 | @@ -XXX,XX +XXX,XX @@ static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n) | 44 | # migration. May cause noticeable delays if the image |
29 | return 0; | 45 | # file is large, do not use in production. |
46 | @@ -XXX,XX +XXX,XX @@ | ||
47 | '*pr-manager': 'str', | ||
48 | '*locking': 'OnOffAuto', | ||
49 | '*aio': 'BlockdevAioOptions', | ||
50 | + '*drop-cache': {'type': 'bool', | ||
51 | + 'if': 'defined(CONFIG_LINUX)'}, | ||
52 | '*x-check-cache-dropped': 'bool' } } | ||
53 | |||
54 | ## | ||
55 | diff --git a/block/file-posix.c b/block/file-posix.c | ||
56 | index XXXXXXX..XXXXXXX 100644 | ||
57 | --- a/block/file-posix.c | ||
58 | +++ b/block/file-posix.c | ||
59 | @@ -XXX,XX +XXX,XX @@ typedef struct BDRVRawState { | ||
60 | bool page_cache_inconsistent:1; | ||
61 | bool has_fallocate; | ||
62 | bool needs_alignment; | ||
63 | + bool drop_cache; | ||
64 | bool check_cache_dropped; | ||
65 | |||
66 | PRManager *pr_mgr; | ||
67 | @@ -XXX,XX +XXX,XX @@ typedef struct BDRVRawState { | ||
68 | typedef struct BDRVRawReopenState { | ||
69 | int fd; | ||
70 | int open_flags; | ||
71 | + bool drop_cache; | ||
72 | bool check_cache_dropped; | ||
73 | } BDRVRawReopenState; | ||
74 | |||
75 | @@ -XXX,XX +XXX,XX @@ static QemuOptsList raw_runtime_opts = { | ||
76 | .type = QEMU_OPT_STRING, | ||
77 | .help = "id of persistent reservation manager object (default: none)", | ||
78 | }, | ||
79 | +#if defined(__linux__) | ||
80 | + { | ||
81 | + .name = "drop-cache", | ||
82 | + .type = QEMU_OPT_BOOL, | ||
83 | + .help = "invalidate page cache during live migration (default: on)", | ||
84 | + }, | ||
85 | +#endif | ||
86 | { | ||
87 | .name = "x-check-cache-dropped", | ||
88 | .type = QEMU_OPT_BOOL, | ||
89 | @@ -XXX,XX +XXX,XX @@ static int raw_open_common(BlockDriverState *bs, QDict *options, | ||
90 | } | ||
30 | } | 91 | } |
31 | 92 | ||
32 | - /* Quota exceeded. Calculate the next time slice we may start | 93 | + s->drop_cache = qemu_opt_get_bool(opts, "drop-cache", true); |
33 | - * sending data again. */ | 94 | s->check_cache_dropped = qemu_opt_get_bool(opts, "x-check-cache-dropped", |
34 | - delay_slices = (limit->dispatched + limit->slice_quota - 1) / | 95 | false); |
35 | - limit->slice_quota; | 96 | |
36 | + /* Quota exceeded. Wait based on the excess amount and then start a new | 97 | @@ -XXX,XX +XXX,XX @@ static int raw_reopen_prepare(BDRVReopenState *state, |
37 | + * slice. */ | 98 | goto out; |
38 | + delay_slices = (double)limit->dispatched / limit->slice_quota; | 99 | } |
39 | limit->slice_end_time = limit->slice_start_time + | 100 | |
40 | - delay_slices * limit->slice_ns; | 101 | + rs->drop_cache = qemu_opt_get_bool_del(opts, "drop-cache", true); |
41 | + (uint64_t)(delay_slices * limit->slice_ns); | 102 | rs->check_cache_dropped = |
42 | return limit->slice_end_time - now; | 103 | qemu_opt_get_bool_del(opts, "x-check-cache-dropped", false); |
43 | } | 104 | |
44 | 105 | @@ -XXX,XX +XXX,XX @@ static void raw_reopen_commit(BDRVReopenState *state) | |
106 | BDRVRawState *s = state->bs->opaque; | ||
107 | Error *local_err = NULL; | ||
108 | |||
109 | + s->drop_cache = rs->drop_cache; | ||
110 | s->check_cache_dropped = rs->check_cache_dropped; | ||
111 | s->open_flags = rs->open_flags; | ||
112 | |||
113 | @@ -XXX,XX +XXX,XX @@ static void coroutine_fn raw_co_invalidate_cache(BlockDriverState *bs, | ||
114 | return; | ||
115 | } | ||
116 | |||
117 | + if (!s->drop_cache) { | ||
118 | + return; | ||
119 | + } | ||
120 | + | ||
121 | if (s->open_flags & O_DIRECT) { | ||
122 | return; /* No host kernel page cache */ | ||
123 | } | ||
45 | -- | 124 | -- |
46 | 2.14.3 | 125 | 2.20.1 |
47 | 126 | ||
48 | 127 | diff view generated by jsdifflib |
Deleted patch | |||
---|---|---|---|
1 | From: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
2 | 1 | ||
3 | s/pupulate/populate | ||
4 | |||
5 | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
6 | Reviewed-by: Peter Maydell <peter.maydell@linaro.org> | ||
7 | Message-id: 20180208162447.10851-1-marcandre.lureau@redhat.com | ||
8 | Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> | ||
9 | --- | ||
10 | util/qemu-coroutine-lock.c | 2 +- | ||
11 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c | ||
14 | index XXXXXXX..XXXXXXX 100644 | ||
15 | --- a/util/qemu-coroutine-lock.c | ||
16 | +++ b/util/qemu-coroutine-lock.c | ||
17 | @@ -XXX,XX +XXX,XX @@ void qemu_co_queue_run_restart(Coroutine *co) | ||
18 | * invalid memory. Therefore, use a temporary queue and do not touch | ||
19 | * the "co" coroutine as soon as you enter another one. | ||
20 | * | ||
21 | - * In its turn resumed "co" can pupulate "co_queue_wakeup" queue with | ||
22 | + * In its turn resumed "co" can populate "co_queue_wakeup" queue with | ||
23 | * new coroutines to be woken up. The caller, who has resumed "co", | ||
24 | * will be responsible for traversing the same queue, which may cause | ||
25 | * a different wakeup order but not any missing wakeups. | ||
26 | -- | ||
27 | 2.14.3 | ||
28 | |||
29 | diff view generated by jsdifflib |