From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyxWk-0002A6-Or for qemu-devel@nongnu.org; Wed, 31 Aug 2011 23:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyxWj-00018A-9g for qemu-devel@nongnu.org; Wed, 31 Aug 2011 23:01:14 -0400 Received: from e23smtp07.au.ibm.com ([202.81.31.140]:55820) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyxWi-00016W-Fz for qemu-devel@nongnu.org; Wed, 31 Aug 2011 23:01:13 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp07.au.ibm.com (8.14.4/8.13.1) with ESMTP id p8130pnH014692 for ; Thu, 1 Sep 2011 13:00:51 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p812xOYY1339538 for ; Thu, 1 Sep 2011 12:59:25 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8130pQu021157 for ; Thu, 1 Sep 2011 13:00:51 +1000 Date: Thu, 1 Sep 2011 11:00:07 +0800 From: Zhi Yong Wu Message-ID: <20110901030007.GB16985@f15.cn.ibm.com> References: <1314786708-3998-1-git-send-email-wuzhy@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1314786708-3998-1-git-send-email-wuzhy@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v6 0/4] The intro of QEMU block I/O throttling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pair@us.ibm.com On Wed, Aug 31, 2011 at 06:31:44PM +0800, Zhi Yong Wu wrote: >Return-Path: >Received: from imap.linux.ibm.com ([unix socket]) by imap.linux.ibm.com > (Cyrus v2.3.16-Fedora-RPM-2.3.16-6.el6_1.2) with LMTPA; Wed, 31 Aug 2011 > 07:10:59 -0400 >X-Sieve: CMU Sieve 2.3 >Received: from localhost (localhost [127.0.0.1]) by imap.linux.ibm.com > (Postfix) with ESMTP id 458A11600040 for ; Wed, > 31 Aug 2011 07:10:59 -0400 (EDT) >X-Virus-Scanned: amavisd-new at linux.ibm.com >X-Spam-Flag: NO >X-Spam-Score: -1.578 >X-Spam-Level: >X-Spam-Status: No, score=-1.578 tagged_above=-9999 required=5 > tests=[ALL_TRUSTED=-1, AWL=-0.037, RP_MATCHES_RCVD=-0.541] > autolearn=disabled >Received: from imap.linux.ibm.com ([127.0.0.1]) by localhost > (maier.raleigh.ibm.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id > IY4ziHLPdPGE for ; Wed, 31 Aug 2011 07:10:43 > -0400 (EDT) >Received: from smtp.linux.ibm.com (smtp.linux.ibm.com [9.26.4.197]) by > imap.linux.ibm.com (Postfix) with ESMTP id 7C6F11600046 for > ; Wed, 31 Aug 2011 06:32:56 -0400 (EDT) >Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com > [9.17.195.107]) by smtp.linux.ibm.com (Postfix) with ESMTP id 2C79EC7A04 > for ; Wed, 31 Aug 2011 06:32:56 -0400 (EDT) >Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com > [9.17.195.167]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) > with ESMTP id p7VAWtDc065946 for ; Wed, 31 Aug 2011 > 04:32:55 -0600 >Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by > d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id > p7VAWtL0020748 for ; Wed, 31 Aug 2011 04:32:55 -0600 >Received: from VMSDVM6.POK.IBM.COM (vmsdvm6.pok.ibm.com [9.57.5.25]) by > d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id > p7VAWskr020721 for <@vm-av.bld.relay.ibm.com:wuzhy@linux.ibm.com>; Wed, 31 > Aug 2011 04:32:54 -0600 >Received: by VMSDVM6.POK.IBM.COM (IBM VM SMTP Level 540) via spool with SMTP > id 4823 ; Wed, 31 Aug 2011 06:32:38 EDT >Received: by vmsdvm6.vnet.ibm.com (xagent2 6.3.1) via xagsmtp4 with spool id > 0929 for wuzhy@linux.vnet.ibm.com; Wed, 31 Aug 2011 06:32:38 -0400 (EDT) >Received: from d03relay03.boulder.ibm.com [9.17.195.228] by > VMSDVM6.POK.IBM.COM (IBM VM SMTP Level 540) via TCP with ESMTP ; Wed, 31 > Aug 2011 06:32:36 EDT >Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com > [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO > v10.0) with ESMTP id p7VAWpoc158318; Wed, 31 Aug 2011 04:32:52 -0600 >Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by > d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id > p7V4Wp7A005389; Tue, 30 Aug 2011 22:32:51 -0600 >Received: from f15.cn.ibm.com ([9.115.118.18]) by d03av04.boulder.ibm.com > (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p7V4WmrS002404 > (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, > 30 Aug 2011 22:32:50 -0600 >Received: from f15 (localhost [127.0.0.1]) by f15.cn.ibm.com > (8.14.4/8.14.4) with ESMTP id p7VAVvbC004033; Wed, 31 Aug 2011 18:31:58 > +0800 >Received: (from root@localhost) by f15 (8.14.4/8.14.4/Submit) id > p7VAVphk004032; Wed, 31 Aug 2011 18:31:52 +0800 >From: Zhi Yong Wu >To: qemu-devel@nongnu.org >Cc: kvm@vger.kernel.org, stefanha@linux.vnet.ibm.com, mtosatti@redhat.com, > aliguori@us.ibm.com, ryanh@us.ibm.com, zwu.kernel@gmail.com, > kwolf@redhat.com, pair@us.ibm.com, Zhi Yong Wu >Subject: [PATCH v6 0/4] The intro of QEMU block I/O throttling >Date: Wed, 31 Aug 2011 18:31:44 +0800 >Message-Id: <1314786708-3998-1-git-send-email-wuzhy@linux.vnet.ibm.com> >X-Mailer: git-send-email 1.7.6 >X-Xagent-From: wuzhy@linux.vnet.ibm.com >X-Xagent-To: wuzhy@linux.vnet.ibm.com >X-Xagent-Gateway: vmsdvm6.vnet.ibm.com (XAGENTU5 at VMSDVM6) > >The main goal of the patch is to effectively cap the disk I/O speed or counts of one single VM.It is only one draft, so it unavoidably has some drawbacks, if you catch them, please let me know. > >The patch will mainly introduce one block I/O throttling algorithm, one timer and one block queue for each I/O limits enabled drive. > >When a block request is coming in, the throttling algorithm will check if its I/O rate or counts exceed the limits; if yes, then it will enqueue to the block queue; The timer will handle the I/O requests in it. > >Some available features follow as below: >(1) global bps limit. > -drive bps=xxx in bytes/s >(2) only read bps limit > -drive bps_rd=xxx in bytes/s >(3) only write bps limit > -drive bps_wr=xxx in bytes/s >(4) global iops limit > -drive iops=xxx in ios/s >(5) only read iops limit > -drive iops_rd=xxx in ios/s >(6) only write iops limit > -drive iops_wr=xxx in ios/s >(7) the combination of some limits. > -drive bps=xxx,iops=xxx > >Known Limitations: >(1) #1 can not coexist with #2, #3 >(2) #4 can not coexist with #5, #6 >(3) When bps/iops limits are specified to a small value such as 511 bytes/s, this VM will hang up. We are considering how to handle this senario. > >Changes since code V5: > Mainly fix the aio callback issue for block queue. Sorry, thanks Ram Pai, some code changes based on his comments. > >Zhi Yong Wu (4): > block: add the command line support > block: add the block queue support > block: add block timer and block throttling algorithm > qmp/hmp: add block_set_io_throttle > > v5: add qmp/hmp support. > Adjust the codes based on stefan's comments > qmp/hmp: add block_set_io_throttle > > v4: fix memory leaking based on ryan's feedback. > > v3: Added the code for extending slice time, and modified the method to compute wait time for the timer. > > v2: The codes V2 for QEMU disk I/O limits. > Modified the codes mainly based on stefan's comments. > > v1: Submit the codes for QEMU disk I/O limits. > Only a code draft. > > Makefile.objs | 2 +- > block.c | 324 +++++++++++++++++++++++++++++++++++++++++++++++++++-- > block.h | 6 +- > block/blk-queue.c | 226 +++++++++++++++++++++++++++++++++++++ > block/blk-queue.h | 63 ++++++++++ > block_int.h | 30 +++++ > blockdev.c | 98 ++++++++++++++++ > blockdev.h | 2 + > hmp-commands.hx | 15 +++ > qemu-config.c | 24 ++++ > qemu-options.hx | 1 + > qerror.c | 4 + > qerror.h | 3 + > qmp-commands.hx | 52 +++++++++- > 14 files changed, 837 insertions(+), 13 deletions(-) > create mode 100644 block/blk-queue.c > create mode 100644 block/blk-queue.h > >-- >1.7.6 >