qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest
@ 2014-03-13 14:17 Peter Maydell
  2014-03-13 14:19 ` Andreas Färber
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Maydell @ 2014-03-13 14:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, Stefan Hajnoczi, patches

When running under qtest we don't actually have any vcpu threads
to be starved, so the warning about the I/O thread spinning isn't
relevant, and the way qtest manipulates the simulated clock means
the warning is produced a lot as a false positive. Suppress it if
qtest_enabled(), so 'make check' output is less noisy.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 main-loop.c         |  3 ++-
 stubs/Makefile.objs |  1 +
 stubs/qtest.c       | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 stubs/qtest.c

diff --git a/main-loop.c b/main-loop.c
index c3c9c28..8a85493 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -25,6 +25,7 @@
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/sockets.h"	// struct in_addr needed for libslirp.h
+#include "sysemu/qtest.h"
 #include "slirp/libslirp.h"
 #include "qemu/main-loop.h"
 #include "block/aio.h"
@@ -208,7 +209,7 @@ static int os_host_main_loop_wait(int64_t timeout)
     if (!timeout && (spin_counter > MAX_MAIN_LOOP_SPIN)) {
         static bool notified;
 
-        if (!notified) {
+        if (!notified && !qtest_enabled()) {
             fprintf(stderr,
                     "main-loop: WARNING: I/O thread spun for %d iterations\n",
                     MAX_MAIN_LOOP_SPIN);
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index df3aa7a..6f06fca 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -28,3 +28,4 @@ stub-obj-y += vmstate.o
 stub-obj-$(CONFIG_WIN32) += fd-register.o
 stub-obj-y += cpus.o
 stub-obj-y += kvm.o
+stub-obj-y += qtest.o
diff --git a/stubs/qtest.c b/stubs/qtest.c
new file mode 100644
index 0000000..e671ed8
--- /dev/null
+++ b/stubs/qtest.c
@@ -0,0 +1,14 @@
+/*
+ * qtest stubs
+ *
+ * Copyright (c) 2014 Linaro Limited
+ * Written by Peter Maydell
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include "qemu-common.h"
+
+/* Needed for qtest_allowed() */
+bool qtest_allowed;
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest
  2014-03-13 14:17 [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest Peter Maydell
@ 2014-03-13 14:19 ` Andreas Färber
  2014-03-13 17:43 ` Stefan Hajnoczi
  2014-03-13 20:39 ` Andreas Färber
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Färber @ 2014-03-13 14:19 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Stefan Hajnoczi, patches

Am 13.03.2014 15:17, schrieb Peter Maydell:
> When running under qtest we don't actually have any vcpu threads
> to be starved, so the warning about the I/O thread spinning isn't
> relevant, and the way qtest manipulates the simulated clock means
> the warning is produced a lot as a false positive. Suppress it if
> qtest_enabled(), so 'make check' output is less noisy.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  main-loop.c         |  3 ++-
>  stubs/Makefile.objs |  1 +
>  stubs/qtest.c       | 14 ++++++++++++++
>  3 files changed, 17 insertions(+), 1 deletion(-)
>  create mode 100644 stubs/qtest.c

Looks OK to me, a bit unfortunate that we need a stub, but

Reviewed-by: Andreas Färber <afaerber@suse.de>

Thanks,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest
  2014-03-13 14:17 [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest Peter Maydell
  2014-03-13 14:19 ` Andreas Färber
@ 2014-03-13 17:43 ` Stefan Hajnoczi
  2014-03-13 20:39 ` Andreas Färber
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2014-03-13 17:43 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Andreas Färber, patches

On Thu, Mar 13, 2014 at 02:17:29PM +0000, Peter Maydell wrote:
> When running under qtest we don't actually have any vcpu threads
> to be starved, so the warning about the I/O thread spinning isn't
> relevant, and the way qtest manipulates the simulated clock means
> the warning is produced a lot as a false positive. Suppress it if
> qtest_enabled(), so 'make check' output is less noisy.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  main-loop.c         |  3 ++-
>  stubs/Makefile.objs |  1 +
>  stubs/qtest.c       | 14 ++++++++++++++
>  3 files changed, 17 insertions(+), 1 deletion(-)
>  create mode 100644 stubs/qtest.c

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest
  2014-03-13 14:17 [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest Peter Maydell
  2014-03-13 14:19 ` Andreas Färber
  2014-03-13 17:43 ` Stefan Hajnoczi
@ 2014-03-13 20:39 ` Andreas Färber
  2014-03-14  0:18   ` Peter Maydell
  2 siblings, 1 reply; 5+ messages in thread
From: Andreas Färber @ 2014-03-13 20:39 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Stefan Hajnoczi, patches

Am 13.03.2014 15:17, schrieb Peter Maydell:
> When running under qtest we don't actually have any vcpu threads
> to be starved, so the warning about the I/O thread spinning isn't
> relevant, and the way qtest manipulates the simulated clock means
> the warning is produced a lot as a false positive. Suppress it if
> qtest_enabled(), so 'make check' output is less noisy.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
[...]
> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
> index df3aa7a..6f06fca 100644
> --- a/stubs/Makefile.objs
> +++ b/stubs/Makefile.objs
> @@ -28,3 +28,4 @@ stub-obj-y += vmstate.o
>  stub-obj-$(CONFIG_WIN32) += fd-register.o
>  stub-obj-y += cpus.o
>  stub-obj-y += kvm.o
> +stub-obj-y += qtest.o
[snip]

Please note that the stubs are supposed to be sorted alphabetically.

I'm still seeing two instances of the warning for i386 and x86_64 each.
But it's a clear improvement.

Thanks, applying to qom-next (with Makefile tweaked):
https://github.com/afaerber/qemu-cpu/commits/qom-next

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest
  2014-03-13 20:39 ` Andreas Färber
@ 2014-03-14  0:18   ` Peter Maydell
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2014-03-14  0:18 UTC (permalink / raw)
  To: Andreas Färber; +Cc: QEMU Developers, Stefan Hajnoczi, Patch Tracking

On 13 March 2014 20:39, Andreas Färber <afaerber@suse.de> wrote:
> Am 13.03.2014 15:17, schrieb Peter Maydell:
>> When running under qtest we don't actually have any vcpu threads
>> to be starved, so the warning about the I/O thread spinning isn't
>> relevant, and the way qtest manipulates the simulated clock means
>> the warning is produced a lot as a false positive. Suppress it if
>> qtest_enabled(), so 'make check' output is less noisy.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> [...]
>> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
>> index df3aa7a..6f06fca 100644
>> --- a/stubs/Makefile.objs
>> +++ b/stubs/Makefile.objs
>> @@ -28,3 +28,4 @@ stub-obj-y += vmstate.o
>>  stub-obj-$(CONFIG_WIN32) += fd-register.o
>>  stub-obj-y += cpus.o
>>  stub-obj-y += kvm.o
>> +stub-obj-y += qtest.o
> [snip]
>
> Please note that the stubs are supposed to be sorted alphabetically.

OK. I looked at the tail end of the file (which as you can see is not
in order) and thought we weren't trying to maintain an order here.
I guess that's just previous commits also adding at the end of the file,
though...

thanks
-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-14  0:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-13 14:17 [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest Peter Maydell
2014-03-13 14:19 ` Andreas Färber
2014-03-13 17:43 ` Stefan Hajnoczi
2014-03-13 20:39 ` Andreas Färber
2014-03-14  0:18   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).