Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2209370iof; Tue, 7 Jun 2022 23:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuCjWc9PKL50osMDGIchO72SkFIBwg/ZkvXvoe+Z/X6bOP5yXfKtR1XAM5HptTavl229hh X-Received: by 2002:a05:6a00:150f:b0:51b:e050:d36e with SMTP id q15-20020a056a00150f00b0051be050d36emr26372564pfu.44.1654668998500; Tue, 07 Jun 2022 23:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668998; cv=none; d=google.com; s=arc-20160816; b=wfmE0dgJBzqAaR4udTt7RAcGyGc98XDRwp2aLnfxyHre+TZiPLHE8h3Vz5VMhFtau6 VPTtZajjOluX95xBvShSS1GE88PCHqn1fa3Oc9JrwZEDwlOUYcpyJjUy6376WEFqK74s vk60y7CBw+jeko9hxUDvPscjepQep4mLpYYf2REzOkHQsgL9y3P59SGjbVn3DjuwHPvd VguG84iuEk+t6gIYLURuRzi7kWScF6vIqyRrl9dZop4YxQARIOa/uatPOamIb8ErJiFH l6pesxvQFlxiJRcvOYonajhAfTdNmzkaAqkn1/ElxIPIOKeDkeUNMZPLXkYEUHIyBwrj MWYA== 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=cu0EFItFXvRK0HKZhBYCGNyd6FEX22BW5hCMjR3xlF8=; b=YkHEAs5RPfFRhIix43epbE8dwmDCl4QZYlHdcrpau2cFFTVWUwz1VFEimaDrBcZUxw WY/ows775kCllRf0+iXuJ6a3SFn7NVDoZfzwTlFzmqbcC8v2rjCSxGMmPEeFwUdHHCsW JjVAY/G28heRgaXtBp3t0wRYjmfWGsJHKHkxr01/iZwwHxNS6B6WGXGZDscUU3IDUmTI qBbEd56sPsWBagiloQ7qrLkXyRNOI8Qi816wfqtl+YmO743RRPwG8OjnHnV1dmUB92qp DRoD05wpqUnNjs1mzNqf9HA7YatcW6hlJH+OD3Hdf9y2ohbBnX6WkW6u9lmnT8cOAlCh UkOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jCSB28CE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s82-20020a632c55000000b003fe22d7613esi2819360pgs.730.2022.06.07.23.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:16:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jCSB28CE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61FF618157C; Tue, 7 Jun 2022 22:37:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390761AbiFHBva (ORCPT + 99 others); Tue, 7 Jun 2022 21:51:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383966AbiFGWJg (ORCPT ); Tue, 7 Jun 2022 18:09:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42F0625912A; Tue, 7 Jun 2022 12:18:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E873161934; Tue, 7 Jun 2022 19:18:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0387AC385A5; Tue, 7 Jun 2022 19:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629535; bh=3fJBXA6aZhNR9OxaZMqECk/6L42UqcFz58XWHO9nFVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jCSB28CEehtIUjRecJ+ys2uPs3vSdQlnfXj3yYfhpqd+ZO2uBeRGCsOU1naVzBRF5 /f3IBN0jxFfkl8dGiaqVio5wMs/C5xDngWpYvX979fn6YBabkllZpmJKAeC3WMYpzD LzVv3WRVaBNUn/s4sH1sW/KuDSNRjQ/p2Aec4Fjc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "yukuai (C)" , Jan Kara , Christoph Hellwig , Jens Axboe Subject: [PATCH 5.18 727/879] bfq: Avoid false marking of bic as stably merged Date: Tue, 7 Jun 2022 19:04:05 +0200 Message-Id: <20220607165023.958429325@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jan Kara commit 70456e5210f40ffdb8f6d905acfdcec5bd5fad9e upstream. bfq_setup_cooperator() can mark bic as stably merged even though it decides to not merge its bfqqs (when bfq_setup_merge() returns NULL). Make sure to mark bic as stably merged only if we are really going to merge bfqqs. CC: stable@vger.kernel.org Tested-by: "yukuai (C)" Fixes: 430a67f9d616 ("block, bfq: merge bursts of newly-created queues") Signed-off-by: Jan Kara Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220401102752.8599-1-jack@suse.cz Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- block/bfq-iosched.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2899,9 +2899,12 @@ bfq_setup_cooperator(struct bfq_data *bf struct bfq_queue *new_bfqq = bfq_setup_merge(bfqq, stable_merge_bfqq); - bic->stably_merged = true; - if (new_bfqq && new_bfqq->bic) - new_bfqq->bic->stably_merged = true; + if (new_bfqq) { + bic->stably_merged = true; + if (new_bfqq->bic) + new_bfqq->bic->stably_merged = + true; + } return new_bfqq; } else return NULL;