From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akue5-0002zI-Gx for qemu-devel@nongnu.org; Tue, 29 Mar 2016 10:29:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akue0-0002TC-Gn for qemu-devel@nongnu.org; Tue, 29 Mar 2016 10:29:25 -0400 Sender: Paolo Bonzini References: <1458837566-108527-1-git-send-email-pbonzini@redhat.com> <1458837566-108527-4-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: <56FA9132.3010006@redhat.com> Date: Tue, 29 Mar 2016 16:29:06 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 3/7] block: move restarting of throttled reqs to block/throttle-groups.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, stefanha@redhat.com, qemu-block@nongnu.org On 29/03/2016 16:14, Alberto Garcia wrote: > On Thu 24 Mar 2016 05:39:22 PM CET, Paolo Bonzini wrote: >> @@ -335,6 +346,11 @@ void throttle_group_config(BlockDriverState *bs, ThrottleConfig *cfg) >> } >> throttle_config(ts, tt, cfg); >> qemu_mutex_unlock(&tg->lock); >> + >> + aio_context_acquire(bdrv_get_aio_context(bs)); >> + qemu_co_enter_next(&bs->throttled_reqs[0]); >> + qemu_co_enter_next(&bs->throttled_reqs[1]); >> + aio_context_release(bdrv_get_aio_context(bs)); >> } > > None of the functions in throttle-groups.c acquire the AioContext > because they all assume that the caller is doing it, so we can do the > same here for consistency. It turns out the caller (qmp_block_set_io_throttle) _is_ doing it, so we can get rid of the aio_context_acquire/release pair here too. Paolo