[Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed

Eric Blake posted 36 patches 7 years, 11 months ago
There is a newer version of this series
[Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed
Posted by Eric Blake 7 years, 11 months ago
From: Peter Xu <peterx@redhat.com>

Start to use dedicate IO thread for QMP monitors that are not using
MUXed chardev.

Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20180309090006.10018-21-peterx@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 monitor.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/monitor.c b/monitor.c
index 905d5efc6fa..dea4111e693 100644
--- a/monitor.c
+++ b/monitor.c
@@ -36,6 +36,7 @@
 #include "net/slirp.h"
 #include "chardev/char-fe.h"
 #include "chardev/char-io.h"
+#include "chardev/char-mux.h"
 #include "ui/qemu-spice.h"
 #include "sysemu/numa.h"
 #include "monitor/monitor.h"
@@ -4533,8 +4534,10 @@ static void monitor_qmp_setup_handlers_bh(void *opaque)
 void monitor_init(Chardev *chr, int flags)
 {
     Monitor *mon = g_malloc(sizeof(*mon));
+    /* Enable IOThread for QMPs that are not using MUX chardev backends. */
+    bool use_io_thr = (!CHARDEV_IS_MUX(chr)) && (flags & MONITOR_USE_CONTROL);

-    monitor_data_init(mon, false, false);
+    monitor_data_init(mon, false, use_io_thr);

     qemu_chr_fe_init(&mon->chr, chr, &error_abort);
     mon->flags = flags;
-- 
2.14.3


Re: [Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed
Posted by Max Reitz 7 years, 10 months ago
On 2018-03-12 19:36, Eric Blake wrote:
> From: Peter Xu <peterx@redhat.com>
> 
> Start to use dedicate IO thread for QMP monitors that are not using
> MUXed chardev.
> 
> Reviewed-by: Fam Zheng <famz@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> Message-Id: <20180309090006.10018-21-peterx@redhat.com>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  monitor.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

It seems the iotests aren't quite ready for this change (breakage in
040, 041, 051, 060, 085, 087, 093, 095, 109, 124, 127, 132, 136, 144,
148, 152, 182, 183, 185, 186; and 030 hangs).

Max

Re: [Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed
Posted by Max Reitz 7 years, 10 months ago
On 2018-03-21 13:37, Max Reitz wrote:
> On 2018-03-12 19:36, Eric Blake wrote:
>> From: Peter Xu <peterx@redhat.com>
>>
>> Start to use dedicate IO thread for QMP monitors that are not using
>> MUXed chardev.
>>
>> Reviewed-by: Fam Zheng <famz@redhat.com>
>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>> Signed-off-by: Peter Xu <peterx@redhat.com>
>> Message-Id: <20180309090006.10018-21-peterx@redhat.com>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>  monitor.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> It seems the iotests aren't quite ready for this change (breakage in
> 040, 041, 051, 060, 085, 087, 093, 095, 109, 124, 127, 132, 136, 144,
> 148, 152, 182, 183, 185, 186; and 030 hangs).

(On second thought, 051, 185, and 186 have probably broken because of
something else.

Max)

Re: [Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed
Posted by Eric Blake 7 years, 10 months ago
On 03/21/2018 07:37 AM, Max Reitz wrote:
> On 2018-03-12 19:36, Eric Blake wrote:
>> From: Peter Xu <peterx@redhat.com>
>>
>> Start to use dedicate IO thread for QMP monitors that are not using
>> MUXed chardev.
>>
>> Reviewed-by: Fam Zheng <famz@redhat.com>
>> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
>> Signed-off-by: Peter Xu <peterx@redhat.com>
>> Message-Id: <20180309090006.10018-21-peterx@redhat.com>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>   monitor.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> It seems the iotests aren't quite ready for this change (breakage in
> 040, 041, 051, 060, 085, 087, 093, 095, 109, 124, 127, 132, 136, 144,
> 148, 152, 182, 183, 185, 186; and 030 hangs).

Serves me right for not testing iotests on my qapi tree as rigoursly as 
I do on my NBD tree.  Fixing this during freeze is acceptable, although 
I'd like it if Peter Xu can take a look instead of just me.

(And still a bummer that iotests aren't being run by 'make check' or CLI 
to have caught it earlier?)

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed
Posted by Dr. David Alan Gilbert 7 years, 10 months ago
* Eric Blake (eblake@redhat.com) wrote:
> On 03/21/2018 07:37 AM, Max Reitz wrote:
> > On 2018-03-12 19:36, Eric Blake wrote:
> > > From: Peter Xu <peterx@redhat.com>
> > > 
> > > Start to use dedicate IO thread for QMP monitors that are not using
> > > MUXed chardev.
> > > 
> > > Reviewed-by: Fam Zheng <famz@redhat.com>
> > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > Signed-off-by: Peter Xu <peterx@redhat.com>
> > > Message-Id: <20180309090006.10018-21-peterx@redhat.com>
> > > Signed-off-by: Eric Blake <eblake@redhat.com>
> > > ---
> > >   monitor.c | 5 ++++-
> > >   1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > It seems the iotests aren't quite ready for this change (breakage in
> > 040, 041, 051, 060, 085, 087, 093, 095, 109, 124, 127, 132, 136, 144,
> > 148, 152, 182, 183, 185, 186; and 030 hangs).
> 
> Serves me right for not testing iotests on my qapi tree as rigoursly as I do
> on my NBD tree.  Fixing this during freeze is acceptable, although I'd like
> it if Peter Xu can take a look instead of just me.
> 
> (And still a bummer that iotests aren't being run by 'make check' or CLI to
> have caught it earlier?)

I'm guessing from those that 030 is the easiest to try and debug because
it hangs and you get a nice backtrace.  The others are a bit mysterious
(I think it's 042 which just has an f in one place in the output rather
than a .)

Dave

> -- 
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.           +1-919-301-3266
> Virtualization:  qemu.org | libvirt.org
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

Re: [Qemu-devel] [PULL 31/36] monitor: enable IO thread for (qmp & !mux) typed
Posted by Peter Xu 7 years, 10 months ago
On Wed, Mar 21, 2018 at 12:11:21PM -0500, Eric Blake wrote:
> On 03/21/2018 07:37 AM, Max Reitz wrote:
> > On 2018-03-12 19:36, Eric Blake wrote:
> > > From: Peter Xu <peterx@redhat.com>
> > > 
> > > Start to use dedicate IO thread for QMP monitors that are not using
> > > MUXed chardev.
> > > 
> > > Reviewed-by: Fam Zheng <famz@redhat.com>
> > > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> > > Signed-off-by: Peter Xu <peterx@redhat.com>
> > > Message-Id: <20180309090006.10018-21-peterx@redhat.com>
> > > Signed-off-by: Eric Blake <eblake@redhat.com>
> > > ---
> > >   monitor.c | 5 ++++-
> > >   1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > It seems the iotests aren't quite ready for this change (breakage in
> > 040, 041, 051, 060, 085, 087, 093, 095, 109, 124, 127, 132, 136, 144,
> > 148, 152, 182, 183, 185, 186; and 030 hangs).
> 
> Serves me right for not testing iotests on my qapi tree as rigoursly as I do
> on my NBD tree.  Fixing this during freeze is acceptable, although I'd like
> it if Peter Xu can take a look instead of just me.
> 
> (And still a bummer that iotests aren't being run by 'make check' or CLI to
> have caught it earlier?)

Hello, Max, Eric,

I'll have a look soon, along with the problem that Marc-Andre
reported.  Will keep you updated.

Thanks,
Peter

-- 
Peter Xu