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: 10441091 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 57F58602BC for ; Thu, 31 May 2018 13:24:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E03828858 for ; Thu, 31 May 2018 13:24:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FBB52967A; Thu, 31 May 2018 13:24: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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, 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 924FB29669 for ; Thu, 31 May 2018 13:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755155AbeEaNYC (ORCPT ); Thu, 31 May 2018 09:24:02 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:40948 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755226AbeEaNXi (ORCPT ); Thu, 31 May 2018 09:23:38 -0400 Received: by mail-wr0-f194.google.com with SMTP id l41-v6so33047324wre.7 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=Ba5NJl+4bEH/GBWYHbQTIWPVGMTvUMXxCrJUkFJnouZCt9DYNjrA3Z5N/+sXLjTXjH FleftIxTr2MvbiQRUuXsCDWH5Ws/ISPve/oQyMUtozrXPOpzwZO9KelF9ghydyfSO5eR d+epNSiCx26r4rJJ3kz8gx8IU6LFXIzMqeg7CduiYg3PamuTP/skC/RTa8TP8W4hAGfn ShvqUETMcWlywrwg3MppCjB/gQZvGE4bKvRS2ZkiZtChtjG0PxqU3//LHyPjc2JbVndB I/cv9mssJryMLu/lmwHAwiOUBUUYsPVCRMIprXKXDWx5kTIKFST7Vj4jKzY5g4lezpjK w/pA== X-Gm-Message-State: ALKqPwfBtL5aqZrHpgg8e0Co6ECgW2i9BVC5PUy5s6Ee3tLlpTmXfUx1 U4CYaBiPF62AkgbhYy4tidmntA== X-Google-Smtp-Source: ADUXVKJM6pOM2iUJpxXhChnM3VtO9YaMluuZW6FMvUhBp+zKosAHGoblFltZauy0jfPZeIuk5iLrcQ== 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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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); }