From patchwork Tue Feb 2 14:24:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephane Gasparini X-Patchwork-Id: 8190781 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 70E109F37A for ; Tue, 2 Feb 2016 14:25:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 774EE200E3 for ; Tue, 2 Feb 2016 14:25:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8FA84200D6 for ; Tue, 2 Feb 2016 14:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754720AbcBBOZL (ORCPT ); Tue, 2 Feb 2016 09:25:11 -0500 Received: from mga01.intel.com ([192.55.52.88]:9874 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754494AbcBBOZK (ORCPT ); Tue, 2 Feb 2016 09:25:10 -0500 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 02 Feb 2016 06:25:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,385,1449561600"; d="scan'208";a="41018497" Received: from sgaspari-mac10.tl.intel.com (HELO localhost.localdomain) ([10.102.161.121]) by fmsmga004.fm.intel.com with ESMTP; 02 Feb 2016 06:25:09 -0800 From: Stephane Gasparini To: linux-block@vger.kernel.org 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, 2 Feb 2016 15:24:45 +0100 Message-Id: <1454423085-73513-2-git-send-email-stephane.gasparini@linux.intel.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454423085-73513-1-git-send-email-stephane.gasparini@linux.intel.com> References: <1454423085-73513-1-git-send-email-stephane.gasparini@linux.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.3 required=5.0 tests=BAYES_00, 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 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; }