qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Bug AioContext polling is not implemented on Windows wi


From: Peter Xu
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
User-agent: Mutt/1.9.1 (2017-09-22)

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 <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]