Received: from eggs.gnu.org ([2001:4830:134:3::10]:39111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoGX7-0003fW-JE for qemu-devel@nongnu.org; Thu, 07 Apr 2016 16:28:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoGX5-0007lR-5X for qemu-devel@nongnu.org; Thu, 07 Apr 2016 16:28:05 -0400 Received: from e06smtp09.uk.ibm.com ([195.75.94.105]:49897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoGX4-0007jc-Rl for qemu-devel@nongnu.org; Thu, 07 Apr 2016 16:28:03 -0400 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Apr 2016 21:27:59 +0100 From: Sascha Silbe In-Reply-To: <57053631.5010009@redhat.com> References: <1459848109-29756-1-git-send-email-silbe@linux.vnet.ibm.com> <1459848109-29756-7-git-send-email-silbe@linux.vnet.ibm.com> <57053631.5010009@redhat.com> Date: Thu, 07 Apr 2016 22:27:55 +0200 Message-ID: <87shyxjh9w.fsf@oc4731375738.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 6/7] qemu-iotests: 141: reduce likelihood of race condition on systems with fast IO List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org, qemu-block@nongnu.org, Kevin Wolf Cc: Tu Bo Dear Max, Max Reitz writes: > On 05.04.2016 11:21, Sascha Silbe wrote: >> On systems with fast IO, qemu-io may write more than 1 MiB before >> receiving the block-job-cancel command, causing the test case to fail. >>=20 >> 141 is inherently racy, but we can at least reduce the likelihood of the >> job completing before the cancel command arrives by bumping the size of >> the data getting written; we'll try 32 MiB for a start. > > Hm, interesting. I tried to prevent this by setting the block jobs' > speed to 1, which should make it stop after the block job has processed > the first block of data. Hmm, seems like I didn't quite understand the way the test works then. @Kevin: Please do NOT queue this patch. @Max: From a cursory glance at the code, maybe your 1 *byte* per second rate limit is being rounded down to 0 *blocks* per second, with 0 meaning no limit? See e.g. mirror_set_speed(). Though I must admit I don't understand how speed=3D0 translates to unlimited (like qapi/block-core.json:block-job-set-speed says). My understanding of ratelimit_calculate_delay() is that speed=3D0 means "1 quantum per time slice", with time slice usually being 100ms; not sure about the quantum. Sascha --=20 Softwareentwicklung Sascha Silbe, Niederhofenstra=C3=9Fe 5/1, 71229 Leonberg https://se-silbe.de/ USt-IdNr. DE281696641