All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.12] iothread: fix breakage on windows
@ 2018-03-22  8:56 Peter Xu
  2018-03-22  9:13 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Xu @ 2018-03-22  8:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: Howard Spoelstra, Paolo Bonzini, Stefan Hajnoczi, peterx

OOB can enable iothread for parsing even on Windows.  We need some tunes
to enable that on Windows otherwise it'll break Windows users.  This
patch fixes the breakage on Windows with qemu-system-ppc.exe.

Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 iothread.c       | 4 ++++
 util/aio-win32.c | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

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");
+    }
 }
-- 
2.14.3

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

* Re: [Qemu-devel] [PATCH for-2.12] iothread: fix breakage on windows
  2018-03-22  8:56 [Qemu-devel] [PATCH for-2.12] iothread: fix breakage on windows Peter Xu
@ 2018-03-22  9:13 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2018-03-22  9:13 UTC (permalink / raw)
  To: Peter Xu, qemu-devel; +Cc: Stefan Hajnoczi, Howard Spoelstra

On 22/03/2018 09:56, Peter Xu wrote:
> OOB can enable iothread for parsing even on Windows.  We need some tunes
> to enable that on Windows otherwise it'll break Windows users.  This
> patch fixes the breakage on Windows with qemu-system-ppc.exe.
> 
> Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
> Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  iothread.c       | 4 ++++
>  util/aio-win32.c | 4 +++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> 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");
> +    }
>  }
> 

Queued, thanks.

Paolo

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

end of thread, other threads:[~2018-03-22  9:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-22  8:56 [Qemu-devel] [PATCH for-2.12] iothread: fix breakage on windows Peter Xu
2018-03-22  9:13 ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.