From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIGgP-0007wM-0s for qemu-devel@nongnu.org; Wed, 20 Mar 2013 06:55:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIGgM-000791-2d for qemu-devel@nongnu.org; Wed, 20 Mar 2013 06:55:48 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:43441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIGgL-00078u-PR for qemu-devel@nongnu.org; Wed, 20 Mar 2013 06:55:45 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Mar 2013 04:55:43 -0600 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 48D8638C8029 for ; Wed, 20 Mar 2013 06:55:41 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2KAtfSb245214 for ; Wed, 20 Mar 2013 06:55:41 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2KAtel7029197 for ; Wed, 20 Mar 2013 07:55:40 -0300 From: Zhi Yong Wu Date: Wed, 20 Mar 2013 18:55:28 +0800 In-Reply-To: <1363770734-30970-2-git-send-email-benoit@irqsave.net> References: <1363770734-30970-1-git-send-email-benoit@irqsave.net> <1363770734-30970-2-git-send-email-benoit@irqsave.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Message-ID: <1363776931.32706.59.camel@f15> Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block: fix bdrv_exceed_iops_limits wait computation Reply-To: wuzhy@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Beno=EEt?= Canet Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Reviewed-by: Zhi Yong Wu On Wed, 2013-03-20 at 10:12 +0100, BenoƮt Canet wrote: > This patch fix an I/O throttling behavior triggered by limiting at 150 iops > and running a load of 50 threads doing random pwrites on a raw virtio device. > > After a few moments the iops count start to oscillate steadily between 0 and a > value upper than the limit. > > As the load keep running the period and the amplitude of the oscillation > increase until io bursts reaching the physical storage max iops count are > done. > > These bursts are followed by guest io starvation. > > As the period of this oscillation cycle is increasing the cause must be a > computation error leading to increase slowly the wait time. > > This patch make the wait time a bit smaller and tests confirm that it solves > the oscillating behavior. > > Signed-off-by: Benoit Canet > --- > block.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/block.c b/block.c > index 0a062c9..455d8b0 100644 > --- a/block.c > +++ b/block.c > @@ -3739,7 +3739,7 @@ static bool bdrv_exceed_iops_limits(BlockDriverState *bs, bool is_write, > } > > /* Calc approx time to dispatch */ > - wait_time = (ios_base + 1) / iops_limit; > + wait_time = ios_base / iops_limit; > if (wait_time > elapsed_time) { > wait_time = wait_time - elapsed_time; > } else { -- Regards, Zhi Yong Wu