From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkByA-0000se-LA for qemu-devel@nongnu.org; Fri, 22 Jul 2011 05:24:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkBy9-0000hV-Ne for qemu-devel@nongnu.org; Fri, 22 Jul 2011 05:24:30 -0400 Received: from e2.ny.us.ibm.com ([32.97.182.142]:60134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkBy9-0000hM-L9 for qemu-devel@nongnu.org; Fri, 22 Jul 2011 05:24:29 -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 p6M92uWh026790 for ; Fri, 22 Jul 2011 05:02:56 -0400 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p6M9O44o119014 for ; Fri, 22 Jul 2011 05:24:08 -0400 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 p6M3O3gH031724 for ; Thu, 21 Jul 2011 21:24:04 -0600 From: Zhi Yong Wu Date: Fri, 22 Jul 2011 17:20:53 +0800 Message-Id: <1311326454-7617-1-git-send-email-wuzhy@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v1 0/1] The draft of the codes 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, zwu.kernel@gmail.com, Zhi Yong Wu , luowenj@cn.ibm.com, raharper@us.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 global timer and one block queue for each I/O limits enabled drive. When a block request is coming in, a block I/O 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): Submit the codes for QEMU disk I/O limits. Makefile.objs | 2 +- block.c | 248 +++++++++++++++++++++++++++++++++++++++++++++++++++++ block.h | 1 - block/blk-queue.c | 99 +++++++++++++++++++++ block/blk-queue.h | 73 ++++++++++++++++ block_int.h | 21 +++++ blockdev.c | 20 +++++ qemu-config.c | 24 +++++ qemu-option.c | 17 ++++ qemu-option.h | 1 + qemu-options.hx | 1 + 11 files changed, 505 insertions(+), 2 deletions(-) create mode 100644 block/blk-queue.c create mode 100644 block/blk-queue.h -- 1.7.2.3