From nobody Wed Nov 5 09:04:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499671469813875.5545610110876; Mon, 10 Jul 2017 00:24:29 -0700 (PDT) Received: from localhost ([::1]:38966 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUT3U-0002xx-I0 for importer@patchew.org; Mon, 10 Jul 2017 03:24:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUSzq-0000LB-Sj for qemu-devel@nongnu.org; Mon, 10 Jul 2017 03:20:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUSzp-0000mh-Ib for qemu-devel@nongnu.org; Mon, 10 Jul 2017 03:20:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44496) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUSzp-0000lJ-BG for qemu-devel@nongnu.org; Mon, 10 Jul 2017 03:20:41 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4AC25C057FAB for ; Mon, 10 Jul 2017 07:20:40 +0000 (UTC) Received: from lemon.redhat.com (ovpn-12-94.pek2.redhat.com [10.72.12.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 32CBF77DC4; Mon, 10 Jul 2017 07:20:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4AC25C057FAB Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=famz@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4AC25C057FAB From: Fam Zheng To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 15:20:24 +0800 Message-Id: <20170710072027.7948-3-famz@redhat.com> In-Reply-To: <20170710072027.7948-1-famz@redhat.com> References: <20170710072027.7948-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 10 Jul 2017 07:20:40 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFC 2/5] iothread: Don't error on windows X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, Fam Zheng , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" aio_context_set_poll_params is called unconditionally from iothread initialization code and the contract is that if max_ns =3D=3D 0 polling is disabled, or otherwise windows reports and error. The current default being non-zero will always make win32 to exit on an "-object iothread" option, which is not nice. Default to zero on windows and keep going. (While we are at it, move the definition to the header, because it will be shared with iothread-group.) Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- include/sysemu/iothread.h | 12 ++++++++++++ iothread.c | 6 ------ util/aio-win32.c | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h index eecfc19..37f033b 100644 --- a/include/sysemu/iothread.h +++ b/include/sysemu/iothread.h @@ -39,4 +39,16 @@ char *iothread_get_id(IOThread *iothread); AioContext *iothread_get_aio_context(IOThread *iothread); void iothread_stop_all(void); =20 +#ifndef _WIN32 +/* Benchmark results from 2016 on NVMe SSD drives show max polling times a= round + * 16-32 microseconds yield IOPS improvements for both iodepth=3D1 and iod= epth=3D32 + * workloads. + */ +#define IOTHREAD_POLL_MAX_NS_DEFAULT 32768ULL +#else +/* Our aio implementation on Windows doesn't support polling, don't enable= it + * by default. */ +#define IOTHREAD_POLL_MAX_NS_DEFAULT 0 +#endif + #endif /* IOTHREAD_H */ diff --git a/iothread.c b/iothread.c index f5a01bb..ce56724 100644 --- a/iothread.c +++ b/iothread.c @@ -30,12 +30,6 @@ typedef ObjectClass IOThreadClass; #define IOTHREAD_CLASS(klass) \ OBJECT_CLASS_CHECK(IOThreadClass, klass, TYPE_IOTHREAD) =20 -/* Benchmark results from 2016 on NVMe SSD drives show max polling times a= round - * 16-32 microseconds yield IOPS improvements for both iodepth=3D1 and iod= epth=3D32 - * workloads. - */ -#define IOTHREAD_POLL_MAX_NS_DEFAULT 32768ULL - static __thread IOThread *my_iothread; =20 AioContext *qemu_get_current_aio_context(void) diff --git a/util/aio-win32.c b/util/aio-win32.c index d8a1b20..3d2de11 100644 --- a/util/aio-win32.c +++ b/util/aio-win32.c @@ -403,5 +403,7 @@ void aio_context_setup(AioContext *ctx) void aio_context_set_poll_params(AioContext *ctx, AioContextPollParams par= ams, Error **errp) { - error_setg(errp, "AioContext polling is not implemented on Windows"); + if (params.max_ns) { + error_setg(errp, "AioContext polling is not implemented on Windows= "); + } } --=20 2.9.4