From patchwork Mon Aug 8 11:14:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 9268157 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 3717C60754 for ; Mon, 8 Aug 2016 11:21:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 282B027D5D for ; Mon, 8 Aug 2016 11:21:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CBA82808C; Mon, 8 Aug 2016 11:21:05 +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 6E14C27D5D for ; Mon, 8 Aug 2016 11:21:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752845AbcHHLUr (ORCPT ); Mon, 8 Aug 2016 07:20:47 -0400 Received: from smtp26.sms.unimo.it ([155.185.44.26]:60022 "EHLO smtp26.sms.unimo.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752123AbcHHLPs (ORCPT ); Mon, 8 Aug 2016 07:15:48 -0400 Received: from [185.14.9.10] (port=55814 helo=localhost.localdomain) by smtp26.sms.unimo.it with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA256:128) (Exim 4.80) (envelope-from ) id 1bWiX3-00051g-DU; Mon, 08 Aug 2016 13:15:46 +0200 From: Paolo Valente To: Jens Axboe , Tejun Heo Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, Arianna Avanzini , Paolo Valente Subject: [PATCH V2 03/22] block, cfq: remove deep seek queues logic Date: Mon, 8 Aug 2016 13:14:58 +0200 Message-Id: <1470654917-4280-4-git-send-email-paolo.valente@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470654917-4280-1-git-send-email-paolo.valente@linaro.org> References: <1470654917-4280-1-git-send-email-paolo.valente@linaro.org> UNIMORE-X-SA-Score: -2.9 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 From: Arianna Avanzini CFQ implements a heuristic to identify seeky queues experiencing large queue depths (>= 4), and let them idle despite their seekiness. This mechanism has no match in BFQ, where idling decisions are taken according to a unified global strategy. In this strategy, all actions are aimed at boosting the throughput, except for when throughput-boosting actions would jeopardize throughput-distribution and latency guarantees. Full details in the commits turning CFQ into BFQ. Signed-off-by: Arianna Avanzini Signed-off-by: Paolo Valente --- block/cfq-iosched.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 1ab8898..04d2298 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -411,7 +411,6 @@ enum cfqq_state_flags { CFQ_CFQQ_FLAG_prio_changed, /* task priority has changed */ CFQ_CFQQ_FLAG_slice_new, /* no requests dispatched in slice */ CFQ_CFQQ_FLAG_sync, /* synchronous queue */ - CFQ_CFQQ_FLAG_deep, /* sync cfqq experienced large depth */ CFQ_CFQQ_FLAG_wait_busy, /* Waiting for next request */ }; @@ -438,7 +437,6 @@ CFQ_CFQQ_FNS(idle_window); CFQ_CFQQ_FNS(prio_changed); CFQ_CFQQ_FNS(slice_new); CFQ_CFQQ_FNS(sync); -CFQ_CFQQ_FNS(deep); CFQ_CFQQ_FNS(wait_busy); #undef CFQ_CFQQ_FNS @@ -3060,15 +3058,12 @@ static struct cfq_queue *cfq_select_queue(struct cfq_data *cfqd) } /* - * This is a deep seek queue, but the device is much faster than - * the queue can deliver, don't idle + * The device is much faster than the queue can deliver: don't idle **/ if (CFQQ_SEEKY(cfqq) && cfq_cfqq_idle_window(cfqq) && (cfq_cfqq_slice_new(cfqq) || - (cfqq->slice_end - now > now - cfqq->slice_start))) { - cfq_clear_cfqq_deep(cfqq); + (cfqq->slice_end - now > now - cfqq->slice_start))) cfq_clear_cfqq_idle_window(cfqq); - } if (cfqq->dispatched && cfq_should_idle(cfqd, cfqq)) { cfqq = NULL; @@ -3649,14 +3644,10 @@ cfq_update_idle_window(struct cfq_data *cfqd, struct cfq_queue *cfqq, enable_idle = old_idle = cfq_cfqq_idle_window(cfqq); - if (cfqq->queued[0] + cfqq->queued[1] >= 4) - cfq_mark_cfqq_deep(cfqq); - if (cfqq->next_rq && (cfqq->next_rq->cmd_flags & REQ_NOIDLE)) enable_idle = 0; else if (!atomic_read(&cic->icq.ioc->active_ref) || - !cfqd->cfq_slice_idle || - (!cfq_cfqq_deep(cfqq) && CFQQ_SEEKY(cfqq))) + !cfqd->cfq_slice_idle || CFQQ_SEEKY(cfqq)) enable_idle = 0; else if (sample_valid(cic->ttime.ttime_samples)) { if (cic->ttime.ttime_mean > cfqd->cfq_slice_idle) @@ -4185,11 +4176,6 @@ static enum hrtimer_restart cfq_idle_slice_timer(struct hrtimer *timer) */ if (!RB_EMPTY_ROOT(&cfqq->sort_list)) goto out_kick; - - /* - * Queue depth flag is reset only when the idle didn't succeed - */ - cfq_clear_cfqq_deep(cfqq); } expire: cfq_slice_expired(cfqd, timed_out);