From patchwork Mon Jul 12 06:06:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 473022 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2702382jao; Mon, 12 Jul 2021 00:54:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1DFha3ZB+OoWTTVC2XB8fPCGxUqtIKxSs2QQXJ82/QpSuUrqq7A/bo4Buown0xyG7jvWx X-Received: by 2002:a05:6402:40c4:: with SMTP id z4mr64041243edb.364.1626076463246; Mon, 12 Jul 2021 00:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626076463; cv=none; d=google.com; s=arc-20160816; b=j33VHYbSLKLlkuDfWwoUInGpeqE6d/ldW1h6Zh6q3uNlRamdJ2hiknrLYozwi0o8hU 2c3mlSkJfrhouxpnokcOtlnWvgfaXuzjaK7dbPrdY2DsMrMn0F9APQxag2NUAMLczk2t mjxgp3oPi2clZkKiML5RmeZn8TDsFJTQziKhVpSBVM1bnXjiiZhsT5hhfqyvK8gGiQDD ZggkY8XwzS4Zw7WGqzIQEzZodMtlDQyEttoyRAHSGdnUg2G76SWKnKt5qRqSQ84nPww5 ITSjiA4OiIlwW7wJf8L9gwExmufWeVCiw+5qO8tDhjt5HVLcyThl/G2Lm2AI6QNPXKvP AQ0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=anmNX/NKG+R8IrxDy925YM5ZX5eHGqnNLvREJS1FAHA=; b=PJygtr7AMtXzaYa5zz0lZBZwSkBqnwKhtew9RFJND+MTyLGknJSROAWV6GtNcjZ+SC aD/n5k7Dhs3u4IiYikJ6O1l3LTb4btQiw2FsRVsnWR+aO1hdX0QsR/0N5PQBxpXnaS+x 89SJMbYQcujpP3IsKb5Fq1NrAYuCqxQyqtKwNxDA0TkjoyCacJBun9ULfSzit1OG983u IP0icDVvvL/CoUOYIcpD6Z8HnHHZNTF2u6vcnkORAKnxVkK4sOXYFXf1PbRGTvCwKMH+ Xa+0yCxQL0JZVWrVUdNdljrt275mISnXg8jpZ+KZBNjp2iib3wLSLGqbBLmMini2MR5K om4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uCHDSdBA; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n21si13642925eda.13.2021.07.12.00.54.23; Mon, 12 Jul 2021 00:54:23 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uCHDSdBA; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352268AbhGLHy1 (ORCPT + 12 others); Mon, 12 Jul 2021 03:54:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:35404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349860AbhGLHuT (ORCPT ); Mon, 12 Jul 2021 03:50:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B4A616147E; Mon, 12 Jul 2021 07:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626075815; bh=qXNh1/Rl1JTG2UeSz/CwiwVyGA9YZ8IA4pSLYJBgW8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uCHDSdBAry7gPMNIe+QtV76Vs3RxtZPCYmMXkuej9o0nwkEfE50FjIkm26OXoii05 lRQLiEUM9LFk6tnyC4QoWmeLQU2MHOpm8CcfeoXZrSjbi3b/RSOme4al9ToKm1H8at 1Ag5zonkExUwMSoxlw6l39gRXVgzpzqMk+Gi3mZw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Valente , Jens Axboe , Sasha Levin Subject: [PATCH 5.13 374/800] block, bfq: reset waker pointer with shared queues Date: Mon, 12 Jul 2021 08:06:37 +0200 Message-Id: <20210712061006.872749843@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060912.995381202@linuxfoundation.org> References: <20210712060912.995381202@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paolo Valente [ Upstream commit 9a2ac41b13c573703d6689f51f3e27dd658324be ] Commit 85686d0dc194 ("block, bfq: keep shared queues out of the waker mechanism") leaves shared bfq_queues out of the waker-detection mechanism. It attains this goal by not updating the pointer last_completed_rq_bfqq, if the last request completed belongs to a shared bfq_queue (so that the pointer will not point to the shared bfq_queue). Yet this has a side effect: the pointer last_completed_rq_bfqq keeps pointing, deceptively, to a bfq_queue that actually is not the last one to have had a request completed. As a consequence, such a bfq_queue may deceptively be considered as a waker of some bfq_queue, even of some shared bfq_queue. To address this issue, reset last_completed_rq_bfqq if the last request completed belongs to a shared queue. Fixes: 85686d0dc194 ("block, bfq: keep shared queues out of the waker mechanism") Signed-off-by: Paolo Valente Link: https://lore.kernel.org/r/20210619140948.98712-8-paolo.valente@linaro.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/bfq-iosched.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 7c62bf093199..2a2e6e4ff0b4 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -6143,11 +6143,13 @@ static void bfq_completed_request(struct bfq_queue *bfqq, struct bfq_data *bfqd) * of other queues. But a false waker will unjustly steal * bandwidth to its supposedly woken queue. So considering * also shared queues in the waking mechanism may cause more - * control troubles than throughput benefits. Then do not set - * last_completed_rq_bfqq to bfqq if bfqq is a shared queue. + * control troubles than throughput benefits. Then reset + * last_completed_rq_bfqq if bfqq is a shared queue. */ if (!bfq_bfqq_coop(bfqq)) bfqd->last_completed_rq_bfqq = bfqq; + else + bfqd->last_completed_rq_bfqq = NULL; /* * If we are waiting to discover whether the request pattern