qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Howard Spoelstra <hsp.cat7@gmail.com>,
	qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Bug AioContext polling is not implemented on Windows with qemu-system-ppc.exe
Date: Thu, 22 Mar 2018 13:19:38 +0800	[thread overview]
Message-ID: <20180322051938.GG32362@xz-mi> (raw)
In-Reply-To: <ed9c25bd-e5be-bde1-2447-775c3bfc93ad@redhat.com>

On Wed, Mar 21, 2018 at 05:37:22PM +0100, Paolo Bonzini wrote:
> On 21/03/2018 17:31, Howard Spoelstra wrote:
> > On Wed, Mar 21, 2018 at 5:25 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >> On 21/03/2018 17:23, Howard Spoelstra wrote:
> >>> warning: FTH: (10844): *** Fault tolerant heap shim applied to current
> >>> process. This is usually due to previous crashes. ***
> >>> [New Thread 10844.0x1224]
> >>> [New Thread 10844.0x2a30]
> >>> [New Thread 10844.0x2594]
> >>> [New Thread 10844.0x32a8]
> >>>
> >>> Thread 1 hit Breakpoint 1, aio_context_set_poll_params (ctx=0xc14a9b0,
> >>> max_ns=32768, grow=0, shrink=0, errp=0x362f968)
> >>>     at util/aio-win32.c:413
> >>> 413     in util/aio-win32.c
> >>> (gdb) s
> >>> error_setg_internal (errp=0x362f968, src=0xe166e0 <__func__.58569+32>
> >>> "util/aio-win32.c", line=413,
> >>>     func=0xe16740 <__func__.59050> "aio_context_set_poll_params",
> >>>     fmt=0xe16708 <__func__.58569+72> "AioContext polling is not
> >>> implemented on Windows") at util/error.c:91
> >>> 91      util/error.c: No such file or directory.
> >>> (gdb) s
> >>> 94      in util/error.c
> >>
> >> Great!  Now do "bt".
> >>
> >> Paolo
> > 
> > (gdb) bt full
> > #0  aio_context_set_poll_params (ctx=0xc16a9b0, max_ns=32768, grow=0,
> > shrink=0, errp=0x362f968) at util/aio-win32.c:413
> >         __func__ = "aio_context_set_poll_params"
> > #1  0x00000000005f7563 in iothread_complete (obj=0xc16a290,
> > errp=0x362fa50) at iothread.c:143
> >         local_error = 0x0
> >         iothread = 0xc16a290
> >         __func__ = "iothread_complete"
> >         name = 0xde8be9 <container_info+265> "user-creatable"
> >         thread_name = 0x400000000 <error: Cannot access memory at
> > address 0x400000000>
> > #2  0x0000000000831716 in user_creatable_complete (obj=0xc16a290,
> > errp=0x362fa50) at qom/object_interfaces.c:24
> >         ucc = 0x7fec650
> >         uc = 0xc16a290
> >         __func__ = "user_creatable_complete"
> > #3  0x000000000082cde1 in object_new_with_propv (typename=0xc4b14b
> > <__func__.56984+43> "iothread", parent=0xc169e50,
> >     id=0xc12494 <__emutls_t.iothread_locked+19167> "mon_iothread",
> > errp=0x14ae260 <error_abort>, vargs=0x362fb20 "")
> >     at qom/object.c:555
> >         obj = 0xc16a290
> >         klass = 0x7fec020
> >         local_err = 0x0
> >         __func__ = "object_new_with_propv"
> > #4  0x000000000082cc67 in object_new_with_props (typename=0xc4b14b
> > <__func__.56984+43> "iothread", parent=0xc169e50,
> >     id=0xc12494 <__emutls_t.iothread_locked+19167> "mon_iothread",
> > errp=0x14ae260 <error_abort>) at qom/object.c:516
> >         vargs = 0x362fb20 ""
> >         obj = 0xd34e26fdf887
> > #5  0x00000000005f7ced in iothread_create (id=0xc12494
> > <__emutls_t.iothread_locked+19167> "mon_iothread",
> > ---Type <return> to continue, or q <return> to quit---
> >     errp=0x14ae260 <error_abort>) at iothread.c:352
> >         obj = 0x45bef7 <sortcmdlist+137>
> >         __func__ = "iothread_create"
> > #6  0x000000000045bf53 in monitor_iothread_init () at
> > /home/hsp/src/qemu-master/monitor.c:4436
> > No locals.
> > #7  0x000000000045bfcb in monitor_init_globals () at
> > /home/hsp/src/qemu-master/monitor.c:4464
> > No locals.
> > #8  0x00000000006064d5 in qemu_main (argc=28, argv=0x5679620,
> > envp=0x0) at vl.c:4545
> >         i = 1
> >         snapshot = 0
> >         linux_boot = 0
> >         initrd_filename = 0x0
> >         kernel_filename = 0x0
> >         kernel_cmdline = 0xc4e286 <runstate_transitions_def+6918> ""
> >         boot_order = 0x57052c0 "d"
> >         boot_once = 0x0
> >         ds = 0x7ff94aced24c
> >         opts = 0x5705100
> >         machine_opts = 0x5705560
> >         icount_opts = 0x0
> >         accel_opts = 0x0
> >         olist = 0xa6e000 <qemu_machine_opts>
> >         optind = 28
> >         optarg = 0x56793dd "file=c:\\Mac-disks\\9.2.img,format=raw,media=disk"
> > ---Type <return> to continue, or q <return> to quit---
> >         loadvm = 0x0
> >         machine_class = 0x7fb28f0
> >         cpu_model = 0x0
> >         vga_model = 0x0
> >         qtest_chrdev = 0x0
> >         qtest_log = 0x0
> >         pid_file = 0x0
> >         incoming = 0x0
> >         userconfig = true
> >         nographic = false
> >         display_remote = 0
> >         log_mask = 0x0
> >         log_file = 0x0
> >         trace_file = 0x0
> >         maxram_size = 268435456
> >         ram_slots = 0
> >         vmstate_dump_file = 0x0
> >         main_loop_err = 0x0
> >         err = 0x0
> >         list_data_dirs = false
> >         dir = 0x8026a80 "c:\\qemu-master"
> >         dirs = 0x8026980
> >         bdo_queue = {sqh_first = 0x0, sqh_last = 0x362fda0}
> >         __func__ = "qemu_main"
> > ---Type <return> to continue, or q <return> to quit---
> > #9  0x00000000005fc507 in SDL_main (argc=28, argv=0x5679620) at vl.c:43
> > No locals.
> > #10 0x000000000096e4e8 in main_getcmdline ()
> > No symbol table info available.
> > #11 0x00000000004013f7 in __tmainCRTStartup () at ../crt/crtexe.c:334
> >         lock_free = <optimized out>
> >         fiberid = <optimized out>
> >         nested = <optimized out>
> >         lpszCommandLine = <optimized out>
> >         StartupInfo = {cb = 104, lpReserved = 0x5787680 "", lpDesktop
> > = 0x57881f0 "Winsta0\\Default",
> >           lpTitle = 0x578c000 "c:\\qemu-master\\qemu-system-ppc.exe",
> > dwX = 0, dwY = 0, dwXSize = 0, dwYSize = 0,
> >           dwXCountChars = 0, dwYCountChars = 0, dwFillAttribute = 0,
> > dwFlags = 0, wShowWindow = 0, cbReserved2 = 0,
> >           lpReserved2 = 0x0, hStdInput = 0xffffffffffffffff,
> > hStdOutput = 0xffffffffffffffff,
> >           hStdError = 0xffffffffffffffff}
> >         inDoubleQuote = <optimized out>
> > #12 0x00000000004014fb in WinMainCRTStartup () at ../crt/crtexe.c:184
> >         ret = 255
> > (gdb)
> > 
> > Finally ;-)
> 
> Great, thanks.  Peter, can you look at it?  I think we should:
> 
> 1) make aio_context_set_poll_params succeed in aio-win32.c if
> poll_max_ns is zero
> 
> 2) set IOTHREAD_POLL_MAX_NS_DEFAULT to zero on windows.

Thanks Paolo!

Hi, Howard,

Thanks for reporting the problem.  Could you try applying below patch
to your rc0 tree and rebuild QEMU, to see whether it fixes your problem?

-----------------------------
diff --git a/iothread.c b/iothread.c
index 1b3463cb00..9f52270ae1 100644
--- a/iothread.c
+++ b/iothread.c
@@ -31,11 +31,15 @@ typedef ObjectClass IOThreadClass;
 #define IOTHREAD_CLASS(klass) \
    OBJECT_CLASS_CHECK(IOThreadClass, klass, TYPE_IOTHREAD)
 
+#ifdef CONFIG_LINUX
 /* Benchmark results from 2016 on NVMe SSD drives show max polling times around
  * 16-32 microseconds yield IOPS improvements for both iodepth=1 and iodepth=32
  * workloads.
  */
 #define IOTHREAD_POLL_MAX_NS_DEFAULT 32768ULL
+#else
+#define IOTHREAD_POLL_MAX_NS_DEFAULT 0ULL
+#endif
 
 static __thread IOThread *my_iothread;
 
diff --git a/util/aio-win32.c b/util/aio-win32.c
index d6d5e02f00..a67b00c6ad 100644
--- a/util/aio-win32.c
+++ b/util/aio-win32.c
@@ -410,5 +410,7 @@ void aio_context_setup(AioContext *ctx)
 void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns,
                                  int64_t grow, int64_t shrink, Error **errp)
 {
-    error_setg(errp, "AioContext polling is not implemented on Windows");
+    if (max_ns) {
+        error_setg(errp, "AioContext polling is not implemented on Windows");
+    }
 }
-----------------------------

Thanks,

-- 
Peter Xu

  reply	other threads:[~2018-03-22  5:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 17:11 [Qemu-devel] Bug AioContext polling is not implemented on Windows with qemu-system-ppc.exe Howard Spoelstra
2018-03-21 11:07 ` Paolo Bonzini
2018-03-21 13:13   ` Howard Spoelstra
2018-03-21 13:22     ` Paolo Bonzini
2018-03-21 13:29       ` Howard Spoelstra
2018-03-21 15:27         ` Paolo Bonzini
2018-03-21 16:23           ` Howard Spoelstra
2018-03-21 16:25             ` Paolo Bonzini
2018-03-21 16:31               ` Howard Spoelstra
2018-03-21 16:37                 ` Paolo Bonzini
2018-03-22  5:19                   ` Peter Xu [this message]
2018-03-22  8:28                     ` Howard Spoelstra
2018-03-22  8:52                       ` Peter Xu
2018-03-22  9:14                     ` Paolo Bonzini
2018-03-22 10:06                       ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180322051938.GG32362@xz-mi \
    --to=peterx@redhat.com \
    --cc=hsp.cat7@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).