From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:50429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QldVm-0001QU-0O for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:01:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QldVk-0004n0-Qw for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:01:09 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:54414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QldVk-0004md-OR for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:01:08 -0400 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p6Q8dWCT010486 for ; Tue, 26 Jul 2011 04:39:32 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6Q90mfR158080 for ; Tue, 26 Jul 2011 05:00:48 -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 p6Q90mvP006064 for ; Tue, 26 Jul 2011 06:00:48 -0300 From: Zhi Yong Wu Date: Tue, 26 Jul 2011 16:57:32 +0800 Message-Id: <1311670653-20425-1-git-send-email-wuzhy@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 0/1] The intro for QEMU disk I/O limits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, kvm@vger.kernel.org, Zhi Yong Wu , zwu.kernel@gmail.com, ryanh@us.ibm.com, luowenj@cn.ibm.com, vgoyal@redhat.com 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 global 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 periodically 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 Zhi Yong Wu (1): 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 | 288 +++++++++++++++++++++++++++++++++++++++++++++++++++-- block.h | 1 - block/blk-queue.c | 116 +++++++++++++++++++++ block/blk-queue.h | 70 +++++++++++++ block_int.h | 28 +++++ blockdev.c | 21 ++++ qemu-config.c | 24 +++++ qemu-option.c | 17 +++ qemu-option.h | 1 + qemu-options.hx | 1 + 11 files changed, 559 insertions(+), 10 deletions(-) create mode 100644 block/blk-queue.c create mode 100644 block/blk-queue.h -- 1.7.2.3