From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbBXY-0002ZW-6v for qemu-devel@nongnu.org; Thu, 26 Mar 2015 13:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbBXT-0005kY-Ve for qemu-devel@nongnu.org; Thu, 26 Mar 2015 13:25:56 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:51998 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbBXT-0005TL-PD for qemu-devel@nongnu.org; Thu, 26 Mar 2015 13:25:51 -0400 From: Alberto Garcia Date: Thu, 26 Mar 2015 19:24:54 +0200 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v4 0/7] 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 A new version of the patchset. Here was the previous one: https://lists.gnu.org/archive/html/qemu-devel/2015-03/msg01990.html I checked all the things pointed out by Stefan in his comments and I think all of them are fixed now. In addition to that I detected and fixed some additional problems. Here's the detailed list of changes: - All functions from the ThrottleGroup API now receive a BlockDriverState. This simplifies the API a bit more and makes it more consistent. - The creation/destruction of ThrottleTimers is now handled internally when a BlockDriverState is added/removed from a group, since there's not much point on keeping them separate. This also hides the timer callbacks from the outside, which makes things a bit nicer and easier for some of the other changes included in these series. - bdrv_io_limits_enable() no longer accepts NULL as a valid group name. - No member of a group can access someone else's throttled_reqs queues anymore since there's no safe way to do it. A new (protected) field in BDS called pending_reqs serves that purpose now. - No member of a group can access someone else's timers unless they have queued requests. A new field in ThrottleGroup called any_timer_armed serves that purpose. This allows changing a BDS's AioContext without having to remove it from the group. Otherwise it's not safe to call bdrv_set_aio_context(). - After a timer is fired make sure that there was actually a request in the queue, and schedule a new one otherwise. This is an unlikely corner case that I detected while preparing these series. - New throttle_group_lock/unlock functions. These are only needed for the case of bdrv_swap(), which is not easy to rewrite in a way that does not crash without locking the group. - throttle_group_co_io_limits_intercept() is now marked as a coroutine function. - Documentation updates. Regards, Berto Alberto Garcia (6): throttle: Add throttle group infrastructure throttle: Add throttle group infrastructure tests throttle: Add throttle group support throttle: acquire the ThrottleGroup lock in bdrv_swap() 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 | 101 ++++----- block/Makefile.objs | 1 + block/qapi.c | 8 +- block/throttle-groups.c | 478 ++++++++++++++++++++++++++++++++++++++++ blockdev.c | 22 +- hmp.c | 10 +- include/block/block.h | 3 +- include/block/block_int.h | 7 +- include/block/throttle-groups.h | 46 ++++ 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, 778 insertions(+), 156 deletions(-) create mode 100644 block/throttle-groups.c create mode 100644 include/block/throttle-groups.h -- 2.1.4