From patchwork Thu May 31 13:23:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 137390 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp6600271lji; Thu, 31 May 2018 06:24:06 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPr+Aa7QuB7ylx47tlL6RXoRAaZaXmBNQpDIymUCVyxTBGrB+4JpHeCEn/RhELPaj04JeX X-Received: by 2002:a17:902:6e08:: with SMTP id u8-v6mr6914142plk.96.1527773046311; Thu, 31 May 2018 06:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527773046; cv=none; d=google.com; s=arc-20160816; b=Rg9I/94GmjJ9zdGVwHgbvxGn7idtybArh3iBeXPwt89/ulnK47wRhpApOGSNNO+1L5 lWQjmMXvu6qSVkvee4pnZZvy5tqucA1jGIVJLFKN4w0hpXQD2KnJM9sYsT2jwR/xxOnJ 5ewTHByNDD0Aj6CHPSK2dTpzSAiNFCL0pr92nyd2Y7aS3ggUSoDmJriff75gy2jbhI2d TY8YVOtGtmCVsDjsGn+5Xi0qQc+KvoX+AhE+4X29AjGP3a5LQB8zCnTbOy2oAOycVY9Y /lEyxWS3tOI0PiixwNn7A2QiuTd7oz07vCIJgRDeL4fi1LDC1gyPalJP7pEdq6I0j3WJ bCcw== 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=SEqMJfUIX3kP85UUaY/w/+7NvrfkRE9rpolvb0MZdLo=; b=NQTpin6U+dGnXMrKJaW7k+erY/b5Zh4YVlR7EThQBcCN6gd+5GpenGFBnaEcKVTMur p8pYozbNn49bNzufrtPRqYJd9XdRmk9dbhllPq29nxek4X2udmu8quALRzQu7D5VexvS wZWez6SUoW9zOcj1/q9fCE79xqkVU1HpybK6jNZ75am6XzuyBYgaJn61hBOurTplys3R dQCk8xPDAWQl9cdIKrQXrIyMsgIQI+1g8g9I3GkHcTiaQvQDa+QhgAOMDwFLQs3O7hX5 62OpFbMvKa30e0PU6+XWe15j2fOHKi88Kswo/6DGspJ7vgAHjHINK0JrjoTOv+iLb2Kp svQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Zpi40Vqy; 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 s24-v6si35432385pfm.257.2018.05.31.06.24.05; Thu, 31 May 2018 06:24:06 -0700 (PDT) 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=Zpi40Vqy; 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 S1755322AbeEaNYE (ORCPT + 30 others); Thu, 31 May 2018 09:24:04 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:36532 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755234AbeEaNXi (ORCPT ); Thu, 31 May 2018 09:23:38 -0400 Received: by mail-wr0-f196.google.com with SMTP id f16-v6so17680097wrm.3 for ; Thu, 31 May 2018 06:23:37 -0700 (PDT) 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=SEqMJfUIX3kP85UUaY/w/+7NvrfkRE9rpolvb0MZdLo=; b=Zpi40VqynHhcXX0OPsnwgYap8+YEDVkpn5LRF9gAqxvyU9btcM66JJwL8mYDxjEEFR MsgerSMn9KAkJZg1NH8SK0B97a1u0okKAWU1/7z43nVBIDapLEq2gOQvft2Ey8qGr4gq F6rS1xY0nfeNgoN3BTgfoMnmaKnpUwBb8aNB8= 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=SEqMJfUIX3kP85UUaY/w/+7NvrfkRE9rpolvb0MZdLo=; b=VfgpyO/ifmSOTvuUJP5YErMlYh42vgs7Ncra6Pa0atJHvBIPRyYcicdyfD2NNcztGD yCmjesasPWdp8o5iQ4cP9mqCw6nO5styFFSk6UNyKcIBEnDgA2hev49ZI6idK0e/vpOi 1LyNkcoOhGXNI203kJRLpAqnYfDQBNtRpRdC5F+4QvOLCvqGIKsuzJyo2T4ARrn8xofM bpgKi6SAQ+VbM+l7ebw3DmmEiVLPcox+We/ZoVBYhRev+wASMQOTrDl5rQ9FV6dgyk8n 7HAIYJc/lvXCBjiuzVlKDN0QpVuvmoAq1nkuqjSBL5Id6ev9/mUiVMUL9ZSZ2GBDEzrW zC3A== X-Gm-Message-State: ALKqPwfnscMNX4JwuwJl5C7x6X7BXJFyW9hUGWlzhulY8kdrSyhXX2N1 qkn4jy7WXW41mP2gxjvrPXzbZwFh+Qc= X-Received: by 2002:adf:891a:: with SMTP id s26-v6mr5133200wrs.276.1527773017025; Thu, 31 May 2018 06:23:37 -0700 (PDT) Received: from localhost.localdomain (146-241-12-84.dyn.eolo.it. [146.241.12.84]) by smtp.gmail.com with ESMTPSA id e133-v6sm1759478wma.38.2018.05.31.06.23.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 06:23:35 -0700 (PDT) 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, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, filippo.muzzini@outlook.it, Paolo Valente Subject: [PATCH BUGFIX 3/3] block, bfq: remove the removal of 'next' rq in bfq_requests_merged Date: Thu, 31 May 2018 15:23:13 +0200 Message-Id: <20180531132313.2986-4-paolo.valente@linaro.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180531132313.2986-1-paolo.valente@linaro.org> References: <20180531132313.2986-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: Filippo Muzzini Since bfq_finish_request() is always called on the request 'next', after bfq_requests_merged() is finished, and bfq_finish_request() removes 'next' from its bfq_queue if needed, it isn't necessary to do such a removal in advance in bfq_merged_requests(). This commit removes such a useless 'next' removal. Signed-off-by: Filippo Muzzini Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 7 ------- 1 file changed, 7 deletions(-) -- 2.16.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index df2a9633cf4a..f71a5846b629 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1897,8 +1897,6 @@ static void bfq_request_merged(struct request_queue *q, struct request *req, * exploits this hook to address the following issue: if 'next' has a * fifo_time lower that rq, then the fifo_time of rq must be set to * the value of 'next', to not forget the greater age of 'next'. - * Moreover 'next' may be in a bfq_queue, in this case it must be - * removed. * * NOTE: in this function we assume that rq is in a bfq_queue, basing * on that rq is picked from the hash table q->elevator->hash, which, @@ -1932,11 +1930,6 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq, if (bfqq->next_rq == next) bfqq->next_rq = rq; - if (!RB_EMPTY_NODE(&next->rb_node)) { - bfq_remove_request(q, next); - bfqg_stats_update_io_remove(bfqq_group(bfqq), next->cmd_flags); - } - bfqg_stats_update_io_merged(bfqq_group(bfqq), next->cmd_flags); }