From patchwork Wed Nov 29 14:49:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fam Zheng X-Patchwork-Id: 842601 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yn3QC2dN3z9s83 for ; Thu, 30 Nov 2017 01:51:28 +1100 (AEDT) Received: from localhost ([::1]:43463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK3ht-00058X-T1 for incoming@patchwork.ozlabs.org; Wed, 29 Nov 2017 09:51:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eK3hR-00058S-Ku for qemu-devel@nongnu.org; Wed, 29 Nov 2017 09:51:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eK3hL-0005Rf-So for qemu-devel@nongnu.org; Wed, 29 Nov 2017 09:50:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59550) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eK3hF-0005OX-V9; Wed, 29 Nov 2017 09:50:46 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF5C2C070158; Wed, 29 Nov 2017 14:50:44 +0000 (UTC) Received: from lemon.redhat.com (ovpn-12-98.pek2.redhat.com [10.72.12.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 976965C670; Wed, 29 Nov 2017 14:49:58 +0000 (UTC) From: Fam Zheng To: qemu-devel@nongnu.org Date: Wed, 29 Nov 2017 22:49:47 +0800 Message-Id: <20171129144956.11409-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Wed, 29 Nov 2017 14:50:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH RFC 0/9] block: Rewrite block drain begin/end X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, jcody@redhat.com, Max Reitz , Stefan Hajnoczi , pbonzini@redhat.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" While we look at the fixes for 2.11, I briefly prototyped this series to see if it makes sense as a simplification of the drain API for 2.12. The idea is to let AioContext manage quiesce callbacks, then the block layer only needs to do the in-flight request waiting. This lets us get rid of the callback recursion (both up and down). Many commit logs and code comments are definitely missing, but it would be good to get high level review and maybe some testing already. Fam Fam Zheng (9): block: Remove unused bdrv_requests_pending aio: Add drain begin/end API to AioContext blockjob: Implement AioContext drain ops throttle: Implement AioContext drain ops qed: Implement AioContext drain ops block: Use aio_context_drained_begin in bdrv_set_aio_context block: Switch to use AIO drained begin/end API block: Drop old drained_{begin,end} callbacks blockjob: Drop unused functions block.c | 30 +-------- block/block-backend.c | 22 ------- block/io.c | 134 +++-------------------------------------- block/qed.c | 34 ++++++++--- block/throttle.c | 34 ++++++++--- blockjob.c | 67 ++++++++------------- include/block/aio.h | 27 ++++++++- include/block/block.h | 16 ----- include/block/block_int.h | 12 ---- include/block/blockjob_int.h | 14 ----- include/sysemu/block-backend.h | 8 --- util/async.c | 73 ++++++++++++++++++++++ 12 files changed, 186 insertions(+), 285 deletions(-)