From patchwork Tue Feb 9 16:07:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephane Gasparini X-Patchwork-Id: 8263631 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 693B29F8AA for ; Tue, 9 Feb 2016 16:18:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 916A220254 for ; Tue, 9 Feb 2016 16:18:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 323742027D for ; Tue, 9 Feb 2016 16:18:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932685AbcBIQSY (ORCPT ); Tue, 9 Feb 2016 11:18:24 -0500 Received: from mga03.intel.com ([134.134.136.65]:10160 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757541AbcBIQIV (ORCPT ); Tue, 9 Feb 2016 11:08:21 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 09 Feb 2016 08:07:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,421,1449561600"; d="scan'208";a="880487885" Received: from tlspnp001.tl.intel.com ([10.237.188.56]) by orsmga001.jf.intel.com with ESMTP; 09 Feb 2016 08:07:55 -0800 From: Stephane Gasparini To: linux-block@vger.kernel.org, linux-pm@vger.kernel.org, lenb@kernel.org, srinivas.pandruvada@linux.intel.com Cc: Stephane Gasparini , len.brown@linux.intel.com, philippe.longepe@linux.intel.com Subject: [PATCH 1/1] kernel/fs: fix I/O wait not accounted for RW O_DSYNC Date: Tue, 9 Feb 2016 17:07:38 +0100 Message-Id: <1455034058-84181-2-git-send-email-stephane.gasparini@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455034058-84181-1-git-send-email-stephane.gasparini@intel.com> References: <1455034058-84181-1-git-send-email-stephane.gasparini@intel.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,LOTS_OF_MONEY, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 From: Stephane Gasparini When a process is doing Random Write with O_DSYNC flag the I/O wait are not accounted in the kernel (get_cpu_iowait_time_us). This is preventing the governor or the cpufreq driver to account for I/O wait and thus use the right pstate Signed-off-by: Stephane Gasparini Signed-off-by: Philippe Longepe --- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c index dbabd48b1934..f53a691b6533 100644 --- a/block/bio.c +++ b/block/bio.c @@ -874,7 +874,7 @@ int submit_bio_wait(int rw, struct bio *bio) bio->bi_private = &ret; bio->bi_end_io = submit_bio_wait_endio; submit_bio(rw, bio); - wait_for_completion(&ret.event); + wait_for_completion_io(&ret.event); return ret.error; }