From patchwork Tue Jun 28 07:04:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9202101 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 D68FA608A6 for ; Tue, 28 Jun 2016 07:04:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C86EB285F4 for ; Tue, 28 Jun 2016 07:04:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD5AE285F6; Tue, 28 Jun 2016 07:04:11 +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 50A7E285F5 for ; Tue, 28 Jun 2016 07:04:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbcF1HEK (ORCPT ); Tue, 28 Jun 2016 03:04:10 -0400 Received: from mx2.suse.de ([195.135.220.15]:49870 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751949AbcF1HEJ (ORCPT ); Tue, 28 Jun 2016 03:04:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 29199ABA6; Tue, 28 Jun 2016 07:04:08 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id ACD8E1E0F12; Tue, 28 Jun 2016 09:04:06 +0200 (CEST) From: Jan Kara To: Jens Axboe Cc: linux-block@vger.kernel.org, Jeff Moyer , Jan Kara Subject: [PATCH 4/4] cfq-iosched: Charge at least 1 jiffie instead of 1 ns Date: Tue, 28 Jun 2016 09:04:02 +0200 Message-Id: <1467097442-5400-5-git-send-email-jack@suse.cz> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1467097442-5400-1-git-send-email-jack@suse.cz> References: <1467097442-5400-1-git-send-email-jack@suse.cz> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 9a7f38c42c2b (cfq-iosched: Convert from jiffies to nanoseconds) could result in charging just 1 ns to a cgroup submitting IO instead of 1 jiffie we always charged before. It is arguable what is the right amount to change but for now lets retain the old behavior of always charging at least one jiffie. Fixes: 9a7f38c42c2b92391d9dabaf9f51df7cfe5608e4 Signed-off-by: Jan Kara --- block/cfq-iosched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index e074dd4f1384..81accf9c4eaf 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -1455,7 +1455,8 @@ static inline u64 cfq_cfqq_slice_usage(struct cfq_queue *cfqq, * a single request on seeky media and cause lots of seek time * and group will never know it. */ - slice_used = max_t(u64, (now - cfqq->dispatch_start), 1); + slice_used = max_t(u64, (now - cfqq->dispatch_start), + jiffies_to_nsecs(1)); } else { slice_used = now - cfqq->slice_start; if (slice_used > cfqq->allocated_slice) {