From patchwork Fri May 6 16:26:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 9034471 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C6D5BF29F for ; Fri, 6 May 2016 16:29:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A8C420394 for ; Fri, 6 May 2016 16:29:07 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 403E620125 for ; Fri, 6 May 2016 16:29:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayiai-0005mu-4S; Fri, 06 May 2016 16:27:00 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayiag-0005mo-PO for xen-devel@lists.xensource.com; Fri, 06 May 2016 16:26:58 +0000 Received: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id 56/16-02833-2D5CC275; Fri, 06 May 2016 16:26:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRWlGSWpSXmKPExsVysWW7jO7Fozr hBpPvKljcm/Ke3YHRY3vfLvYAxijWzLyk/IoE1ozz7QtYCg7yVGxYfo2tgXEiZxcjF4eQwE4m icMTmpghnKOMErfWbmTpYuTgYBNQkfi1KqaLkZNDREBS4nfXabAaZoFPjBIT359gAUkIC3hKf Jm+ixXEZhFQlVizbAMrSC+vgIPE11WpIGFOAUeJJSd+gZUIAYWPPn8I1iohoC1xauN39gmM3A sYGVYxqhenFpWlFuma6SUVZaZnlOQmZuboGhqa6OWmFhcnpqfmJCYV6yXn525iBHqXAQh2MP6 d4HyIUZKDSUmU93uBTrgQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCV4RYLAICRalpqdWpGXmAMMM Ji3BwaMkwqt9BCjNW1yQmFucmQ6ROsWoy3Hg6Zu9TEIsefl5qVLivItAigRAijJK8+BGwEL+E qOslDAvI9BRQjwFqUW5mSWo8q8YxTkYlYR5FUAu4cnMK4Hb9AroCCagI97P1QQ5oiQRISXVwF h2KGZ11j8ex8NKr27+T7y1LXAFs37w91va8vKBO3LT5K5Vqn5lY9jzgHFiF+PaCcHtFkldJSH /Hpb6N5n/9+K1mJK+q8h9pc4a8zX3WM99zJHn0Hd4U9Q5pzMjdvM9a0HXiqSpkoWCvSGH7l69 WPyg0ur0530J998rvW404VIs3BubyqvbocRSnJFoqMVcVJwIAJ4iEoB0AgAA X-Env-Sender: eblake@redhat.com X-Msg-Ref: server-4.tower-27.messagelabs.com!1462552015!39149641!1 X-Originating-IP: [209.132.183.28] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMjA5LjEzMi4xODMuMjggPT4gNTQwNjQ=\n X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 11180 invoked from network); 6 May 2016 16:26:57 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by server-4.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 6 May 2016 16:26:57 -0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9386947B; Fri, 6 May 2016 16:26:55 +0000 (UTC) Received: from red.redhat.com (ovpn-113-38.phx2.redhat.com [10.3.113.38]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u46GQn2h016098; Fri, 6 May 2016 12:26:54 -0400 From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 6 May 2016 10:26:34 -0600 Message-Id: <1462552005-4887-9-git-send-email-eblake@redhat.com> In-Reply-To: <1462552005-4887-1-git-send-email-eblake@redhat.com> References: <1462552005-4887-1-git-send-email-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Cc: kwolf@redhat.com, Stefano Stabellini , qemu-block@nongnu.org, Max Reitz , "open list:X86" , Anthony Perard Subject: [Xen-devel] [PATCH v7 08/19] xen_disk: Switch to byte-based aio block access X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Sector-based blk_aio_readv() and blk_aio_writev() should die; switch to byte-based blk_aio_preadv() and blk_aio_pwritev() instead. Signed-off-by: Eric Blake --- hw/block/xen_disk.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c index d4ce380..064c116 100644 --- a/hw/block/xen_disk.c +++ b/hw/block/xen_disk.c @@ -554,9 +554,8 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) block_acct_start(blk_get_stats(blkdev->blk), &ioreq->acct, ioreq->v.size, BLOCK_ACCT_READ); ioreq->aio_inflight++; - blk_aio_readv(blkdev->blk, ioreq->start / BLOCK_SIZE, - &ioreq->v, ioreq->v.size / BLOCK_SIZE, - qemu_aio_complete, ioreq); + blk_aio_preadv(blkdev->blk, ioreq->start, &ioreq->v, 0, + qemu_aio_complete, ioreq); break; case BLKIF_OP_WRITE: case BLKIF_OP_FLUSH_DISKCACHE: @@ -569,9 +568,8 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq) ioreq->req.operation == BLKIF_OP_WRITE ? BLOCK_ACCT_WRITE : BLOCK_ACCT_FLUSH); ioreq->aio_inflight++; - blk_aio_writev(blkdev->blk, ioreq->start / BLOCK_SIZE, - &ioreq->v, ioreq->v.size / BLOCK_SIZE, - qemu_aio_complete, ioreq); + blk_aio_pwritev(blkdev->blk, ioreq->start, &ioreq->v, 0, + qemu_aio_complete, ioreq); break; case BLKIF_OP_DISCARD: {