Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2197750iof; Tue, 7 Jun 2022 22:57:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq0SMHrN0+qQBEAyyggN1GasCdRN87PVesJCxzxoofulfm81GeM7B4dgeuOTFjYv4I85y4 X-Received: by 2002:a17:90b:17c7:b0:1e8:5136:c32a with SMTP id me7-20020a17090b17c700b001e85136c32amr24039122pjb.43.1654667841701; Tue, 07 Jun 2022 22:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667841; cv=none; d=google.com; s=arc-20160816; b=DMuOqaCBiwdJivdrujWX/vSUWB883ODv8jVBSh8Hgq18jWQtyjvjp1YhQz0hhOcW4o gEz2kvbrN7t1nyLLhqQx1L8jmnI1eKbfirx3wzI5xTg7YMu2iprylSuoVm1zJVbav5Wi G9L+XassArMGU1Wk+VCyyXjgHQmPZc6JbVrxuI3G3Y7eQHpdBMNvd/p26jqg00XWDaG3 WjmNxTlOI1kMexE+S2YNRjLfFJkgbifgHVXXjeqQ9/9d7HgBzdSRVHv9mj5lB7ZZeucI sN/RulaCDNB/tE5pdi8k7lRH91iMQrmMUe4hNCSdziRRZ+uL0znwJFuXdpV1s3IdVMXI HGOQ== 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=8gSYjrNXc9DMT36b624hP1Fv6g5JhFIoG3OVyjcP3ZQ=; b=bZKMyQsA+H5AuEfjHCu5T9a2qaY8zdUguS9Nvyg0Q62h+gN/3yQYkdeR2AwP/0o8m2 rU6B8HOPR5STedFkxCS4m48qr9YfSggGRxVlB4hyM8ryg6rprNV1CIzOEiXOs7hiwWB7 uDX2hp3borxVQvLo2QS32g/e+qDSz2MJowPbMPS04YjQqtmHDd3IVp5OuIMkliza9KTf DBI1S4sJ4f+9wU5MFyWGnaiaQ7KUzLbf/NywkEANq+PIM724eFAadEnr13/2QkaNG2lT aEYiSCrbvqG/JK5JEACUFctaZcM4FnuYYwRAHr4Z0bxvXbH06z16f8OERieXx1vkOtgJ mF+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OVOLfmJ+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id l189-20020a6388c6000000b003fcea90e5casi22929971pgd.542.2022.06.07.22.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:57:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OVOLfmJ+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 DECD84B3F41; Tue, 7 Jun 2022 22:23:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233335AbiFHBDY (ORCPT + 99 others); Tue, 7 Jun 2022 21:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382077AbiFGVtP (ORCPT ); Tue, 7 Jun 2022 17:49:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6718E23B16C; Tue, 7 Jun 2022 12:08:27 -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 ams.source.kernel.org (Postfix) with ESMTPS id C1EF1B823AE; Tue, 7 Jun 2022 19:08:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37893C385A2; Tue, 7 Jun 2022 19:08:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628904; bh=qQ0YjxnZQvxSQTGjIGeL6SfYRSKc91YwVecaQwBg3as=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OVOLfmJ+Gph3+N7jBYXbm6Uw0MVV7tVtF0heytvf07rxKdPaIhZXnFWz35UqGB15D xJO9ept2Pfqq3xo12KPuPCMjVe0gh6brgrXT65KTdS7Vqln492mr/narc+zCWznmmX 3PeDwq/8Ud/XfcZihJIiob89nOyCz4oC4NsGODbI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jan Kara , Jens Axboe , Sasha Levin Subject: [PATCH 5.18 496/879] bfq: Allow current waker to defend against a tentative one Date: Tue, 7 Jun 2022 19:00:14 +0200 Message-Id: <20220607165017.269021227@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 [ Upstream commit c5ac56bb6110e42e79d3106866658376b2e48ab9 ] The code in bfq_check_waker() ignores wake up events from the current waker. This makes it more likely we select a new tentative waker although the current one is generating more wake up events. Treat current waker the same way as any other process and allow it to reset the waker detection logic. Fixes: 71217df39dc6 ("block, bfq: make waker-queue detection more robust") Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20220519105235.31397-2-jack@suse.cz Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/bfq-iosched.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index e1c86f66400e..269ff82091cc 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2133,8 +2133,7 @@ static void bfq_check_waker(struct bfq_data *bfqd, struct bfq_queue *bfqq, if (!bfqd->last_completed_rq_bfqq || bfqd->last_completed_rq_bfqq == bfqq || bfq_bfqq_has_short_ttime(bfqq) || - now_ns - bfqd->last_completion >= 4 * NSEC_PER_MSEC || - bfqd->last_completed_rq_bfqq == bfqq->waker_bfqq) + now_ns - bfqd->last_completion >= 4 * NSEC_PER_MSEC) return; /* -- 2.35.1