From patchwork Wed Dec 20 11:38:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 10125567 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 103B56057F for ; Wed, 20 Dec 2017 11:39:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A92129612 for ; Wed, 20 Dec 2017 11:39:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F388129711; Wed, 20 Dec 2017 11:39:29 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 97F2029710 for ; Wed, 20 Dec 2017 11:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755257AbdLTLj0 (ORCPT ); Wed, 20 Dec 2017 06:39:26 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37990 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755154AbdLTLjV (ORCPT ); Wed, 20 Dec 2017 06:39:21 -0500 Received: by mail-wm0-f66.google.com with SMTP id 64so9123044wme.3 for ; Wed, 20 Dec 2017 03:39:20 -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=ErN9MVCc7+5ZbfMB2t6kzsPh1Xw65tj7g1Knz3fHQ7s=; b=EgqmUUCqXYWHM4xaOd4rYDmYlQoxQKzjPIEeDQ03ARrLi2BycMa2vI9XD69bIxyBQh gURIyfc2bL/uhDx+DBeV8bScduFpPki0tVkjkppH6uEGARiepYPKg8zzEt7gzquY5efG +eWPgrEAoWcA5GQRJu81fn2IQo2BwZ9GWSLLA= 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=ErN9MVCc7+5ZbfMB2t6kzsPh1Xw65tj7g1Knz3fHQ7s=; b=HCJIKLfJi3VffAIg7R2iuNV8W2IvrU1/7qQ27nVzkG2E7dmLUEtaQZMRqqRxwN+t68 KxOmltuJANwtm1pzYIuEhJwHmAxfLrL2rbW/eKPql0clSsGseLvmiQPOPjsafwh3n9cm HZG6rWdLmeluyyNq19pmvNcGRIQHU9A+RZBnOEm3fP40Jnz63MCajH1PWqDYVXKoSEx4 Hty2alSfTk5YzlXiSaWmUdVc1uwSUCcCF3WGCXOqlZAtvLjwA03NjCiM8vSIPoEI6sMm raqU8hLwT4Ujd9SxXIhOCtcrOTUxcFdDH9Fct0mGnokfVNwW5VpcDucdZL5uIjhN3qtC dJ9g== X-Gm-Message-State: AKGB3mKQpvdb974VyJEB4R7RrysvtNhu5CFf0JrsLgJddDxwM0iRgMVY kYluQwAzXp3OeytmBFHGBSvo7Q== X-Google-Smtp-Source: ACJfBov7dXGWi7ZHRsF+9bujwvzPxU1qXWbK7ojsL1riTzEhFSJ/R/bikzMbrBhs6O3J37NmpiKdMQ== X-Received: by 10.28.47.66 with SMTP id v63mr6170335wmv.144.1513769960224; Wed, 20 Dec 2017 03:39:20 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 03:39:18 -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 1/4] block, bfq: add missing rq_pos_tree update on rq removal Date: Wed, 20 Dec 2017 12:38:31 +0100 Message-Id: <20171220113834.2578-2-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-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If two processes do I/O close to each other, then BFQ merges the bfq_queues associated with these processes, to get a more sequential I/O, and thus a higher throughput. In this respect, to detect whether two processes are doing I/O close to each other, BFQ keeps a list of the head-of-line I/O requests of all active bfq_queues. The list is ordered by initial sectors, and implemented through a red-black tree (rq_pos_tree). Unfortunately, the update of the rq_pos_tree was incomplete, because the tree was not updated on the removal of the head-of-line I/O request of a bfq_queue, in case the queue did not remain empty. This commit adds the missing update. Signed-off-by: Paolo Valente Signed-off-by: Angelo Ruocco --- block/bfq-iosched.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index a9e06217e64d..c6f0b93a769c 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1627,6 +1627,8 @@ static void bfq_remove_request(struct request_queue *q, rb_erase(&bfqq->pos_node, bfqq->pos_root); bfqq->pos_root = NULL; } + } else { + bfq_pos_tree_add_move(bfqd, bfqq); } if (rq->cmd_flags & REQ_META)