From patchwork Fri Jun 16 14:04:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 9791787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70F5B6038F for ; Fri, 16 Jun 2017 14:06:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77A9628564 for ; Fri, 16 Jun 2017 14:06:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6CD5A28654; Fri, 16 Jun 2017 14:06:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4E5928564 for ; Fri, 16 Jun 2017 14:05:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754034AbdFPOF5 (ORCPT ); Fri, 16 Jun 2017 10:05:57 -0400 Received: from mx2.suse.de ([195.135.220.15]:33756 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753971AbdFPOFz (ORCPT ); Fri, 16 Jun 2017 10:05:55 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A8591ABB1; Fri, 16 Jun 2017 14:05:54 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 45086DA8FD; Fri, 16 Jun 2017 16:04:50 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: anand.jain@oracle.com, David Sterba Subject: [PATCH 2/3 v2] btrfs: account as waiting for IO, while waiting fot the flush bio completion Date: Fri, 16 Jun 2017 16:04:50 +0200 Message-Id: X-Mailer: git-send-email 2.13.0 In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Similar to what submit_bio_wait does, we should account for IO while waiting for a bio completion. This has marginal visible effects, flush bio is short-lived. Reviewed-by: Anand Jain Signed-off-by: David Sterba --- fs/btrfs/disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index d824c0fc6821..85f931c5e63c 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3520,7 +3520,7 @@ static int wait_dev_flush(struct btrfs_device *device) return 0; device->flush_bio_sent = 0; - wait_for_completion(&device->flush_wait); + wait_for_completion_io(&device->flush_wait); if (bio->bi_error) { ret = bio->bi_error;