From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVM8Y-0003Df-4O for qemu-devel@nongnu.org; Tue, 10 Mar 2015 11:32:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVM8S-0007wE-3p for qemu-devel@nongnu.org; Tue, 10 Mar 2015 11:32:01 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:13014 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVM8R-0007fp-UJ for qemu-devel@nongnu.org; Tue, 10 Mar 2015 11:31:56 -0400 From: Alberto Garcia Date: Tue, 10 Mar 2015 17:30:44 +0200 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v3 0/6] Block Throttle Group Support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Alberto Garcia , Stefan Hajnoczi Hello, here's the new version of the block throttling patches. After the discussions from the previous thread, this one is significantly rewritten from the original code. The main change is in the group throttling API, which is -I believe- much simpler now. The code in block.c and throttle.c also needs far fewer changes. Here's what's new: - The following calls are no longer part of the API, and are now handled internally: throttle_group_incref() throttle_group_unref() throttle_group_set_token() throttle_group_token() throttle_group_lock() throttle_group_unlock() - New throttle_group_config() and throttle_group_get_config() calls, that can be called concurrently by the members of the same group. - bdrv_throttle_group_add/remove() have been merged into throttle_group_register/unregister_bs() and moved to throttle-groups.c. The result of this is that in the sequence throttle_group_incref() + bdrv_throttle_group_add() + throttle_group_register_bs() only this last calls remains and takes care of everything else. - The algorithm in bdrv_io_limits_intercept() and friends has been simplified and moved to throttle-groups.c. - The any_timer_armed array no longer exists. The group throttling code checks the timers directly to see if any of them is pending. - The tests have been adapted to the new API. - The code is hopefully better documented now. There's still the question of what to do with the QMP API to get all throttling groups, but since there is no consensus yet I haven't included it in this series. And I think that's all. As usual, comments and feedback are welcome. Berto Alberto Garcia (5): throttle: Add throttle group infrastructure throttle: Add throttle group infrastructure tests throttle: Add throttle group support throttle: add the name of the ThrottleGroup to BlockDeviceInfo throttle: Update throttle infrastructure copyright BenoƮt Canet (1): throttle: Extract timers from ThrottleState into a separate structure block.c | 82 ++++----- block/Makefile.objs | 1 + block/qapi.c | 8 +- block/throttle-groups.c | 371 ++++++++++++++++++++++++++++++++++++++++ blockdev.c | 19 +- hmp.c | 10 +- include/block/block.h | 3 +- include/block/block_int.h | 9 +- include/block/throttle-groups.h | 45 +++++ include/qemu/throttle.h | 46 +++-- qapi/block-core.json | 8 +- qemu-options.hx | 1 + qmp-commands.hx | 3 +- tests/test-throttle.c | 119 +++++++++---- util/throttle.c | 81 +++++---- 15 files changed, 665 insertions(+), 141 deletions(-) create mode 100644 block/throttle-groups.c create mode 100644 include/block/throttle-groups.h -- 2.1.4