From patchwork Tue Dec 29 20:16:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Moise <00moses.alexander00@gmail.com> X-Patchwork-Id: 7930641 X-Patchwork-Delegate: axboe@kernel.dk Return-Path: X-Original-To: patchwork-linux-block@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 7826BBEEE5 for ; Tue, 29 Dec 2015 20:17:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D1FA20173 for ; Tue, 29 Dec 2015 20:17:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD4A420145 for ; Tue, 29 Dec 2015 20:17:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753712AbbL2URB (ORCPT ); Tue, 29 Dec 2015 15:17:01 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35897 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753661AbbL2URA (ORCPT ); Tue, 29 Dec 2015 15:17:00 -0500 Received: by mail-wm0-f45.google.com with SMTP id l65so42353417wmf.1; Tue, 29 Dec 2015 12:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=b/V6v3r9g37t+npUjgzeqFoLMnTrrx3sUdACWNnVYKA=; b=GPjdkzHnpqaMVCEwOTgthoXgUSSt6/It7tGm02KAvyJ2ic6nF1VqHeEkwwaDKM3GnL RPpnAvDimqpiMS38OLRfaLuJFVSTgVpHysNjFkvhsAlNjgppSUi0rUDlJ4MelmHOviK/ /zVKSrW6SndqgyC2zY/HEtz68X5eU5nmyIYeiz83M33jLiIzpX1SP5vYCpiyI5w3tuXQ hammFWq14in+0Bxr6Ei2jKsZypJlu0wpqOztsxDi4QoGhNJlFf8q66Ik5LfcwJlunQfQ iFiAd5S862Wc8BXVDwogx0zz175wmgPxAaKp7/HfWpndcJ9MwcHaC7A6Fg5sbezKK/h0 qXWw== X-Received: by 10.194.119.68 with SMTP id ks4mr65076917wjb.45.1451420219322; Tue, 29 Dec 2015 12:16:59 -0800 (PST) Received: from gmail.com (catv-188-142-165-239.catv.broadband.hu. [188.142.165.239]) by smtp.gmail.com with ESMTPSA id ft4sm62345202wjb.37.2015.12.29.12.16.58 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 29 Dec 2015 12:16:58 -0800 (PST) From: Alexandru Moise <00moses.alexander00@gmail.com> X-Google-Original-From: Alexandru Moise <00moses.alexader00@gmail.com> Date: Tue, 29 Dec 2015 21:16:49 +0100 To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, 00moses.alexander00@gmail.com Subject: [PATCH v2] cfq-iosched: convert group idle time to jiffies Message-ID: <20151229201649.GA31593@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 This patch refers to Jens Axboe's change way back in 2006: 7b14e3b52 cfq-iosched: slice expiry fixups In this patch he fixed a potential timer race condition by delaying idle_slice_timer by the slice_idle time value. Today this timer is delayed by either slice_idle or group_idle time values, which on my system, and according to Documentation/block/cfq-iosched.txt the default value for group_idle is 8ms. Since the time given by group_idle is supposed to be in milliseconds we should convert that value from milliseconds to jiffies before adding it to jiffies variable and setting our timer. Signed-off-by: Alexandru Moise <00moses.alexader00@gmail.com> --- V2: slice_idle not in miliseconds, convert only group_idle block/cfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 1f9093e..088c45d 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -2954,7 +2954,7 @@ static void cfq_arm_slice_timer(struct cfq_data *cfqd) cfq_mark_cfqq_wait_request(cfqq); if (group_idle) - sl = cfqd->cfq_group_idle; + sl = msecs_to_jiffies(cfqd->cfq_group_idle); else sl = cfqd->cfq_slice_idle;