From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhi Yong Wu Subject: [PATCH v4 0/3] The intro for QEMU disk I/O limits Date: Mon, 1 Aug 2011 14:25:52 +0800 Message-ID: <1312179955-23536-1-git-send-email-wuzhy@linux.vnet.ibm.com> Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, kvm@vger.kernel.org, mtosatti@redhat.com, zwu.kernel@gmail.com, Zhi Yong Wu , luowenj@cn.ibm.com, raharper@us.ibm.com To: qemu-devel@nongnu.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org 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. Zhi Yong Wu (3): v4: fix memory leaking based on ryan's feedback. The cmd support for QEMU block I/O throttling The support for block queue The support for queue timer and throttling algorithm 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 | 302 +++++++++++++++++++++++++++++++++++++++++++++++++++-- block.h | 1 - block/blk-queue.c | 122 +++++++++++++++++++++ block/blk-queue.h | 71 +++++++++++++ block_int.h | 29 +++++ blockdev.c | 22 ++++ qemu-config.c | 24 ++++ qemu-option.c | 17 +++ qemu-option.h | 1 + qemu-options.hx | 1 + 11 files changed, 582 insertions(+), 10 deletions(-) create mode 100644 block/blk-queue.c create mode 100644 block/blk-queue.h -- 1.7.2.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnlzy-0003sk-EE for qemu-devel@nongnu.org; Mon, 01 Aug 2011 02:29:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qnlzx-0005ip-FH for qemu-devel@nongnu.org; Mon, 01 Aug 2011 02:29:10 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:39865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnlzx-0005il-A5 for qemu-devel@nongnu.org; Mon, 01 Aug 2011 02:29:09 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e35.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p7169ptq028256 for ; Mon, 1 Aug 2011 00:09:51 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p716T7RL171288 for ; Mon, 1 Aug 2011 00:29:07 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p710T5tG026213 for ; Sun, 31 Jul 2011 18:29:06 -0600 From: Zhi Yong Wu Date: Mon, 1 Aug 2011 14:25:52 +0800 Message-Id: <1312179955-23536-1-git-send-email-wuzhy@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v4 0/3] 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, mtosatti@redhat.com, zwu.kernel@gmail.com, Zhi Yong Wu , luowenj@cn.ibm.com, raharper@us.ibm.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 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. Zhi Yong Wu (3): v4: fix memory leaking based on ryan's feedback. The cmd support for QEMU block I/O throttling The support for block queue The support for queue timer and throttling algorithm 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 | 302 +++++++++++++++++++++++++++++++++++++++++++++++++++-- block.h | 1 - block/blk-queue.c | 122 +++++++++++++++++++++ block/blk-queue.h | 71 +++++++++++++ block_int.h | 29 +++++ blockdev.c | 22 ++++ qemu-config.c | 24 ++++ qemu-option.c | 17 +++ qemu-option.h | 1 + qemu-options.hx | 1 + 11 files changed, 582 insertions(+), 10 deletions(-) create mode 100644 block/blk-queue.c create mode 100644 block/blk-queue.h -- 1.7.2.3