diff mbox series

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

Message ID 20180312183628.394722-32-eblake@redhat.com
State New
Headers show
Series [PULL,01/36] qapi2texi: minor python code simplification | expand

Commit Message

Eric Blake March 12, 2018, 6:36 p.m. UTC
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(-)

Comments

Max Reitz March 21, 2018, 12:37 p.m. UTC | #1
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
Max Reitz March 21, 2018, 12:41 p.m. UTC | #2
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)
Eric Blake March 21, 2018, 5:11 p.m. UTC | #3
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?)
Dr. David Alan Gilbert March 21, 2018, 5:15 p.m. UTC | #4
* 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
Peter Xu March 22, 2018, 3:09 a.m. UTC | #5
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
diff mbox series

Patch

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;