From patchwork Wed Dec 20 11:38:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 122461 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5452201qgn; Wed, 20 Dec 2017 03:39:40 -0800 (PST) X-Google-Smtp-Source: ACJfBovZdsFj2I2SDcsuGG5oaAs8/vZB1L5X2C6oz2EtclZkwwi9RxL2J3oI90Jr+sRlzZHBRpAS X-Received: by 10.84.218.72 with SMTP id f8mr6843133plm.143.1513769980867; Wed, 20 Dec 2017 03:39:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513769980; cv=none; d=google.com; s=arc-20160816; b=hp3KeG1xByQdrz4FrZEugQKdYkh8hYGLye950imrH6JKtdbOpXY21a+A8gp5ROAmNi oABqjATVa2AYCMCHU2BF/GJy3biOrLe/OfGiKG2xkd3AlK2EWIwrvij0hbhq4vXyQM6g qH88ebzJR/SG6/sQFjSAc/JDULZMwy+XgMKsVeeTTux5ayUtdgU0u1BTfJ9g7P0VMe5v V9IMCLw80GXpF6JpCVtuzknjgz3JbXn67fWZVUSxMHW92s1n2kOsToT8ifyAjiLahMm1 48buBMKIUfMLZ7FzzUHK2rWCbuFHvtQ4gB5RbTBGVkmwXGUxXxj/Riu8XAcjshq6awyk Bkbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=pcqAnNIwcvmEufgTac7uUsP5d7eBX/9awX2+Cg/30dc=; b=FdJ5YnZtOMDNEFEkR0W3COxWb3xj50WPruuQCQjd7SXttpLnGgUInc4dgl3vz7ZIJS WqmQG7PxucYFpjpw9kBbQFnk7HhgKnUuJDzjqsm5ldxEvdDxjHEEGe7e3dnzU/wEhp/U 55idKGcN+0HSucWHumHJDV7RHMifyvs9IphuXOQV7JgGCX0eu6rrKkZryK5yzn9m3Fih W6QQ/LfUXmtSTvvknKT4K4Q2IZuo8O7P4eH46oKOWEo7JojCvfsRMDy0alXS5a4Schrr H6EDvHO8dnAeEUKLNM87eupRWZdWWkLjIquqolbN8kecCphyE6a7p0z2ssOVTBVawQRu dk6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dkd43blY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u63si11752493pgc.269.2017.12.20.03.39.40; Wed, 20 Dec 2017 03:39:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dkd43blY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755293AbdLTLjf (ORCPT + 28 others); Wed, 20 Dec 2017 06:39:35 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36405 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755240AbdLTLjX (ORCPT ); Wed, 20 Dec 2017 06:39:23 -0500 Received: by mail-wm0-f65.google.com with SMTP id b76so9211668wmg.1 for ; Wed, 20 Dec 2017 03:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pcqAnNIwcvmEufgTac7uUsP5d7eBX/9awX2+Cg/30dc=; b=Dkd43blY6j4jG/3OA4wZInwyIxkl0Xix5SGw7h+f5IuoDoCqhW9gxU02woQAQ0GiTZ O+DPTUbe3yVAwwPHh9YipqQ3Rco4wZtIOT4rfwnQTgOSXn6xdSYeemfxelgINZ/pls/E xaW5zes5jboG9TPqzGYd+cBWBBTGFNRGWpQUw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pcqAnNIwcvmEufgTac7uUsP5d7eBX/9awX2+Cg/30dc=; b=n+2il2Jwg/s/33t/iBi+DbRQJlmK4lQ6DBg21JsHzLVCFrcuahkcT8vwfxID3q+YRV v6ytS/L5+ZSx6TsiQIcikNImdPVnDzENfq3sYxuI2jmvTx+Nmm/w+rHH34+RJPXRgIdi 0zT7TwT1jvRV/SK/rXgWYHAhc82plR5qCGFd2EqfDSvYSiO43AAAEXyJaxN4sBhkwsS2 gCqwerfEMlY8QET64ja6dgstk2jRojiooqWcRA7H3u6KyTq5aLRwqQ8Fw5MSxoNSUgyB Hdt7QK8m1gjg8fmF07txKYNWBIi7cguW2TOr4ngs00LUGnEXt54D3D4zpHSw1/IX/wZd ejyA== X-Gm-Message-State: AKGB3mJVA83szezoP/SRXdOQkU1NrQTaCIpb4GqBseZ08lAAZIRP8Z32 jw9rLSEmh41XgPwiXkOQ68VBpQ== X-Received: by 10.28.116.19 with SMTP id p19mr5890253wmc.152.1513769962081; Wed, 20 Dec 2017 03:39:22 -0800 (PST) Received: from wifi-122_dhcprange-89.wifi.unimo.it (wifi-122_dhcprange-89.wifi.unimo.it. [155.185.122.89]) by smtp.gmail.com with ESMTPSA id o27sm9704436wro.9.2017.12.20.03.39.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 03:39:21 -0800 (PST) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, broonie@kernel.org, linus.walleij@linaro.org, angeloruocco90@gmail.com, bfq-iosched@googlegroups.com, Paolo Valente Subject: [PATCH IMPROVEMENT/BUGFIX 2/4] block, bfq: check low_latency flag in bfq_bfqq_save_state() Date: Wed, 20 Dec 2017 12:38:32 +0100 Message-Id: <20171220113834.2578-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171220113834.2578-1-paolo.valente@linaro.org> References: <20171220113834.2578-1-paolo.valente@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Angelo Ruocco A just-created bfq_queue will certainly be deemed as interactive on the arrival of its first I/O request, if the low_latency flag is set. Yet, if the queue is merged with another queue on the arrival of its first I/O request, it will not have the chance to be flagged as interactive. Nevertheless, if the queue is then split soon enough, it has to be flagged as interactive after the split. To handle this early-merge scenario correctly, BFQ saves the state of the queue, on the merge, as if the latter had already been deemed interactive. So, if the queue is split soon, it will get weight-raised, because the previous state of the queue is resumed on the split. Unfortunately, in the act of saving the state of the newly-created queue, BFQ doesn't check whether the low_latency flag is set, and this causes early-merged queues to be then weight-raised, on queue splits, even if low_latency is off. This commit addresses this problem by adding the missing check. Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.15.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index c6f0b93a769c..f58367ef98c1 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2064,7 +2064,8 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq) bic->saved_in_large_burst = bfq_bfqq_in_large_burst(bfqq); bic->was_in_burst_list = !hlist_unhashed(&bfqq->burst_list_node); if (unlikely(bfq_bfqq_just_created(bfqq) && - !bfq_bfqq_in_large_burst(bfqq))) { + !bfq_bfqq_in_large_burst(bfqq) && + bfqq->bfqd->low_latency)) { /* * bfqq being merged right after being created: bfqq * would have deserved interactive weight raising, but