Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29362C636D7 for ; Sun, 19 Feb 2023 02:41:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbjBSClo (ORCPT ); Sat, 18 Feb 2023 21:41:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbjBSCl2 (ORCPT ); Sat, 18 Feb 2023 21:41:28 -0500 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33E6311EB2; Sat, 18 Feb 2023 18:41:26 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4PK8v42lPhz4f3mLg; Sun, 19 Feb 2023 10:41:20 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgBH7utQjPFjPmleDw--.7604S3; Sun, 19 Feb 2023 10:41:22 +0800 (CST) From: Kemeng Shi To: paolo.valente@linaro.org, axboe@kernel.dk, jack@suse.cz Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, shikemeng@huaweicloud.com Subject: [PATCH 01/17] block, bfq: properly mark bfqq remained idle Date: Sun, 19 Feb 2023 18:42:53 +0800 Message-Id: <20230219104309.1511562-2-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230219104309.1511562-1-shikemeng@huaweicloud.com> References: <20230219104309.1511562-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBH7utQjPFjPmleDw--.7604S3 X-Corem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xBIdaVFxhVjvjDU0xZFpf9x0pR3PE3UUUUU = X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Bfqq activation will try to recover the "service hole" of bfqq which may issues requests greedily while remained idle for other reasons: CPU high load, bfqq not enjoying idling, I/O throttling somewhere in the path from the process to the I/O scheduler. So we should mark bfqq remained idle when expired for two reasons: BFQQE_NO_MORE_REQUESTS or BFQQE_TOO_IDLE. More details can be found in comment of bfq_bfqq_update_budg_for_activation. So we should mark bfqq remained idle expired for BFQQE_NO_MORE_REQUESTS or BFQQE_TOO_IDLE instead of (reason != BFQQE_BUDGET_TIMEOUT && reason != BFQQE_BUDGET_EXHAUSTED). Signed-off-by: Kemeng Shi --- block/bfq-iosched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 777dcab73c8e..3f5c740664ce 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -4420,8 +4420,8 @@ void bfq_bfqq_expire(struct bfq_data *bfqd, /* mark bfqq as waiting a request only if a bic still points to it */ if (!bfq_bfqq_busy(bfqq) && - reason != BFQQE_BUDGET_TIMEOUT && - reason != BFQQE_BUDGET_EXHAUSTED) { + reason == BFQQE_NO_MORE_REQUESTS && + reason == BFQQE_TOO_IDLE) { bfq_mark_bfqq_non_blocking_wait_rq(bfqq); /* * Not setting service to 0, because, if the next rq -- 2.30.0