From nobody Sun May 5 05:56:09 2024 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518545306722913.7181886427354; Tue, 13 Feb 2018 10:08:26 -0800 (PST) Received: from localhost ([::1]:57607 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elf0B-00065O-0X for importer@patchew.org; Tue, 13 Feb 2018 13:08:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eleTe-0002Fn-Ep for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eleTa-0003BC-GB for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:46 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:39062 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eleTa-0003Ac-Bk for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B92EB4040855; Tue, 13 Feb 2018 17:34:40 +0000 (UTC) Received: from localhost (ovpn-117-252.ams2.redhat.com [10.36.117.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 998D2AEE1E; Tue, 13 Feb 2018 17:34:36 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 13 Feb 2018 17:34:25 +0000 Message-Id: <20180213173429.19501-2-stefanha@redhat.com> In-Reply-To: <20180213173429.19501-1-stefanha@redhat.com> References: <20180213173429.19501-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 13 Feb 2018 17:34:40 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 13 Feb 2018 17:34:40 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 1/5] Add a git-publish configuration file 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: Kevin Wolf , Paolo Bonzini , Fam Zheng , Stefan Hajnoczi , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fam Zheng git-publish [1] is a convenient tool to send patches and has been popular among QEMU developers. Recently it has been made available in Fedora official repo thanks to Stefan's work. One nice feature of the tool is a per-project configuration with profiles, especially in which the cccmd option is a handy method to create the Cc list. [1]: https://github.com/stefanha/git-publish Signed-off-by: Fam Zheng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 20180205054725.25634-2-famz@redhat.com Signed-off-by: Stefan Hajnoczi --- .gitpublish | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .gitpublish diff --git a/.gitpublish b/.gitpublish new file mode 100644 index 0000000000..ed48f6e52c --- /dev/null +++ b/.gitpublish @@ -0,0 +1,58 @@ +# +# Common git-publish profiles that can be used to send patches to QEMU ups= tream. +# +# See https://github.com/stefanha/git-publish for more information +# +[gitpublishprofile "default"] +base =3D master +prefix =3D PATCH +to =3D qemu-devel@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null + +[gitpublishprofile "rfc"] +base =3D master +prefix =3D RFC PATCH +to =3D qemu-devel@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null + +[gitpublishprofile "stable"] +base =3D master +prefix =3D PATCH +to =3D qemu-devel@nongnu.org +cc =3D qemu-stable@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null + +[gitpublishprofile "trivial"] +base =3D master +prefix =3D PATCH +to =3D qemu-devel@nongnu.org +cc =3D qemu-trivial@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null + +[gitpublishprofile "block"] +base =3D master +prefix =3D PATCH +to =3D qemu-devel@nongnu.org +cc =3D qemu-block@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null + +[gitpublishprofile "arm"] +base =3D master +prefix =3D PATCH +to =3D qemu-devel@nongnu.org +cc =3D qemu-arm@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null + +[gitpublishprofile "s390"] +base =3D master +prefix =3D PATCH +to =3D qemu-devel@nongnu.org +cc =3D qemu-s390@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null + +[gitpublishprofile "ppc"] +base =3D master +prefix =3D PATCH +to =3D qemu-devel@nongnu.org +cc =3D qemu-ppc@nongnu.org +cccmd =3D scripts/get_maintainer.pl --noroles --norolestats --nogit --nogi= t-fallback 2>/dev/null --=20 2.14.3 From nobody Sun May 5 05:56:09 2024 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518546295537478.21648225944125; Tue, 13 Feb 2018 10:24:55 -0800 (PST) Received: from localhost ([::1]:60080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elfGA-00052Y-Lw for importer@patchew.org; Tue, 13 Feb 2018 13:24:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eleTe-0002Fk-Dm for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eleTa-0003BR-RG for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:46 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:57508 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eleTa-0003B4-MU for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4576E40FB646; Tue, 13 Feb 2018 17:34:42 +0000 (UTC) Received: from localhost (ovpn-117-252.ams2.redhat.com [10.36.117.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9DF3AEE1E; Tue, 13 Feb 2018 17:34:41 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 13 Feb 2018 17:34:26 +0000 Message-Id: <20180213173429.19501-3-stefanha@redhat.com> In-Reply-To: <20180213173429.19501-1-stefanha@redhat.com> References: <20180213173429.19501-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 13 Feb 2018 17:34:42 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 13 Feb 2018 17:34:42 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 2/5] README: Document 'git-publish' workflow 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: Kevin Wolf , Paolo Bonzini , Fam Zheng , Stefan Hajnoczi , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fam Zheng [Fixed s/git-profile/git-publish/ typo and s/for once/the first time/. --Stefan] Signed-off-by: Fam Zheng Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 20180205054725.25634-3-famz@redhat.com Signed-off-by: Stefan Hajnoczi --- README | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README b/README index 2c8e1c8cc4..627633fe1d 100644 --- a/README +++ b/README @@ -56,12 +56,41 @@ The QEMU source code is maintained under the GIT versio= n control system. =20 git clone git://git.qemu.org/qemu.git =20 -When submitting patches, the preferred approach is to use 'git +When submitting patches, one common approach is to use 'git format-patch' and/or 'git send-email' to format & send the mail to the qemu-devel@nongnu.org mailing list. All patches submitted must contain a 'Signed-off-by' line from the author. Patches should follow the guidelines set out in the HACKING and CODING_STYLE files. =20 +A 'git-publish' utility was created to make above process less +cumbersome, and is highly recommended for making regular contributions, +or even just for sending consecutive patch series revisions. It also +requires a working 'git send-email' setup, and by default doesn't +automate everything, so you may want to go through the above steps +manually the first time. + +For installation instructions, please go to + + https://github.com/stefanha/git-publish + +The workflow with 'git-publish' is: + + $ git checkout master -b my-feature + $ # work on new commits, add your 'Signed-off-by' lines to each + $ git publish + +Your patch series will be sent and tagged as my-feature-v1 if you need to = refer +back to it in the future. + +Sending v2: + + $ git checkout my-feature # same topic branch + $ # making changes to the commits (using 'git rebase', for example) + $ git publish + +Your patch series will be sent with 'v2' tag in the subject and the git tip +will be tagged as my-feature-v2. + Additional information on submitting patches can be found online via the QEMU website =20 --=20 2.14.3 From nobody Sun May 5 05:56:09 2024 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518546115459980.2862513058201; Tue, 13 Feb 2018 10:21:55 -0800 (PST) Received: from localhost ([::1]:59708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elfDE-0002E1-Eq for importer@patchew.org; Tue, 13 Feb 2018 13:21:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eleTe-0002Fl-E9 for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eleTc-0003C7-KD for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:46 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:51834 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eleTc-0003Bu-GB for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:44 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F472EB6F9; Tue, 13 Feb 2018 17:34:44 +0000 (UTC) Received: from localhost (ovpn-117-252.ams2.redhat.com [10.36.117.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id C20F12024CA2; Tue, 13 Feb 2018 17:34:43 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 13 Feb 2018 17:34:27 +0000 Message-Id: <20180213173429.19501-4-stefanha@redhat.com> In-Reply-To: <20180213173429.19501-1-stefanha@redhat.com> References: <20180213173429.19501-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 13 Feb 2018 17:34:44 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 13 Feb 2018 17:34:44 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 3/5] vl: pause vcpus before stopping iothreads 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: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi , Peter Maydell 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" Commit dce8921b2baaf95974af8176406881872067adfa ("iothread: Stop threads before main() quits") introduced iothread_stop_all() to avoid the following virtio-scsi assertion failure: assert(blk_get_aio_context(d->conf.blk) =3D=3D s->ctx); Back then the assertion failed because when bdrv_close_all() made d->conf.blk NULL, blk_get_aio_context() returned the global AioContext instead of s->ctx. The same assertion can still fail today when vcpus submit new I/O requests after iothread_stop_all() has moved the BDS to the global AioContext. This patch hardens the iothread_stop_all() approach by pausing vcpus before calling iothread_stop_all(). Note that the assertion failure is a race condition. It is not possible to reproduce it reliably. Signed-off-by: Stefan Hajnoczi Message-id: 20180201110708.8080-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- vl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 21878496ec..7a5554bc41 100644 --- a/vl.c +++ b/vl.c @@ -4767,10 +4767,18 @@ int main(int argc, char **argv, char **envp) =20 main_loop(); replay_disable_events(); + + /* The ordering of the following is delicate. Stop vcpus to prevent n= ew + * I/O requests being queued by the guest. Then stop IOThreads (this + * includes a drain operation and completes all request processing). = At + * this point emulated devices are still associated with their IOThrea= ds + * (if any) but no longer have any work to do. Only then can we close + * block devices safely because we know there is no more I/O coming. + */ + pause_all_vcpus(); iothread_stop_all(); - - pause_all_vcpus(); bdrv_close_all(); + res_free(); =20 /* vhost-user must be cleaned up before chardevs. */ --=20 2.14.3 From nobody Sun May 5 05:56:09 2024 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518546463639518.243389865372; Tue, 13 Feb 2018 10:27:43 -0800 (PST) Received: from localhost ([::1]:60190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elfIj-0007Th-Qx for importer@patchew.org; Tue, 13 Feb 2018 13:27:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eleTj-0002Ja-1k for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eleTe-0003EJ-UZ for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:51 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38534 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eleTe-0003Du-Pe for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:46 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63F374022909; Tue, 13 Feb 2018 17:34:46 +0000 (UTC) Received: from localhost (ovpn-117-252.ams2.redhat.com [10.36.117.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A3432024CA2; Tue, 13 Feb 2018 17:34:45 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 13 Feb 2018 17:34:28 +0000 Message-Id: <20180213173429.19501-5-stefanha@redhat.com> In-Reply-To: <20180213173429.19501-1-stefanha@redhat.com> References: <20180213173429.19501-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 13 Feb 2018 17:34:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 13 Feb 2018 17:34:46 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 4/5] ratelimit: don't align wait time with slices 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: Kevin Wolf , Paolo Bonzini , Wolfgang Bumiller , Stefan Hajnoczi , Peter Maydell 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" From: Wolfgang Bumiller It is possible for rate limited writes to keep overshooting a slice's quota by a tiny amount causing the slice-aligned waiting period to effectively halve the rate. Signed-off-by: Wolfgang Bumiller Reviewed-by: Alberto Garcia Message-id: 20180207071758.6818-1-w.bumiller@proxmox.com Signed-off-by: Stefan Hajnoczi --- include/qemu/ratelimit.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h index 8dece483f5..1b38291823 100644 --- a/include/qemu/ratelimit.h +++ b/include/qemu/ratelimit.h @@ -36,7 +36,7 @@ typedef struct { static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t= n) { int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_REALTIME); - uint64_t delay_slices; + double delay_slices; =20 assert(limit->slice_quota && limit->slice_ns); =20 @@ -55,12 +55,11 @@ static inline int64_t ratelimit_calculate_delay(RateLim= it *limit, uint64_t n) return 0; } =20 - /* Quota exceeded. Calculate the next time slice we may start - * sending data again. */ - delay_slices =3D (limit->dispatched + limit->slice_quota - 1) / - limit->slice_quota; + /* Quota exceeded. Wait based on the excess amount and then start a new + * slice. */ + delay_slices =3D (double)limit->dispatched / limit->slice_quota; limit->slice_end_time =3D limit->slice_start_time + - delay_slices * limit->slice_ns; + (uint64_t)(delay_slices * limit->slice_ns); return limit->slice_end_time - now; } =20 --=20 2.14.3 From nobody Sun May 5 05:56:09 2024 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1518546064518937.480149272664; Tue, 13 Feb 2018 10:21:04 -0800 (PST) Received: from localhost ([::1]:59705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1elfCI-0001Su-7c for importer@patchew.org; Tue, 13 Feb 2018 13:20:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eleTj-0002Jd-2z for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eleTi-0003G2-9d for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:51 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52364 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eleTi-0003Fo-5R for qemu-devel@nongnu.org; Tue, 13 Feb 2018 12:34:50 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA9327CBA5; Tue, 13 Feb 2018 17:34:49 +0000 (UTC) Received: from localhost (ovpn-117-252.ams2.redhat.com [10.36.117.252]) by smtp.corp.redhat.com (Postfix) with ESMTP id 821CBAEE1E; Tue, 13 Feb 2018 17:34:47 +0000 (UTC) From: Stefan Hajnoczi To: Date: Tue, 13 Feb 2018 17:34:29 +0000 Message-Id: <20180213173429.19501-6-stefanha@redhat.com> In-Reply-To: <20180213173429.19501-1-stefanha@redhat.com> References: <20180213173429.19501-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 13 Feb 2018 17:34:49 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 13 Feb 2018 17:34:49 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 5/5] misc: fix spelling 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: Kevin Wolf , Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Stefan Hajnoczi , Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau s/pupulate/populate Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Peter Maydell Message-id: 20180208162447.10851-1-marcandre.lureau@redhat.com Signed-off-by: Stefan Hajnoczi --- util/qemu-coroutine-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coroutine-lock.c index 78fb79acf8..5a80c10690 100644 --- a/util/qemu-coroutine-lock.c +++ b/util/qemu-coroutine-lock.c @@ -89,7 +89,7 @@ void qemu_co_queue_run_restart(Coroutine *co) * invalid memory. Therefore, use a temporary queue and do not touch * the "co" coroutine as soon as you enter another one. * - * In its turn resumed "co" can pupulate "co_queue_wakeup" queue with + * In its turn resumed "co" can populate "co_queue_wakeup" queue with * new coroutines to be woken up. The caller, who has resumed "co", * will be responsible for traversing the same queue, which may cause * a different wakeup order but not any missing wakeups. --=20 2.14.3