From mboxrd@z Thu Jan 1 00:00:00 1970 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 29ACFC433F5 for ; Mon, 25 Apr 2022 16:17:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243312AbiDYQUC (ORCPT ); Mon, 25 Apr 2022 12:20:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243305AbiDYQUA (ORCPT ); Mon, 25 Apr 2022 12:20:00 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 906AF23156; Mon, 25 Apr 2022 09:16:55 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3AD571F38C; Mon, 25 Apr 2022 16:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650903414; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bIwwrsg+enqFDb2rJvlESBhPlFgt7kfPl8/6sFp+bG0=; b=sRbvsAnizf/F9KDooxHTNKtEJdyzQweIGyZFUYzrUiq8lmNDWR+lpPsZ/WzeO1WaWHnynU zBnkzUIxj19/+T4lfeXdhwvEsQZLKD/33Ql1asGVI/ouknhpEZiKhRYQSWDLtVzxV9npQ1 dyFWVN2J5JY76LQDzc0A0QJK4XFj/Kg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650903414; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bIwwrsg+enqFDb2rJvlESBhPlFgt7kfPl8/6sFp+bG0=; b=iisCUOPk+a+/hBsTd7hc2OaQug+soVsBQbHZ3K0t659HMN/3Lfu7KeZpOgtBNKGjUOv8RQ JSoNQMoza/SVSNBg== Received: from quack3.suse.cz (unknown [10.100.224.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 22F0B2C143; Mon, 25 Apr 2022 16:16:53 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 8D187A0620; Mon, 25 Apr 2022 18:16:50 +0200 (CEST) Date: Mon, 25 Apr 2022 18:16:50 +0200 From: Jan Kara To: "yukuai (C)" Cc: Jan Kara , paolo.valente@linaro.org, axboe@kernel.dk, tj@kernel.org, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [PATCH -next v2 2/5] block, bfq: add fake weight_counter for weight-raised queue Message-ID: <20220425161650.xzyijgkb5yzviea3@quack3.lan> References: <20220416093753.3054696-1-yukuai3@huawei.com> <20220416093753.3054696-3-yukuai3@huawei.com> <20220425094856.qgkhba2klguduxot@quack3.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On Mon 25-04-22 21:34:16, yukuai (C) wrote: > 在 2022/04/25 17:48, Jan Kara 写道: > > On Sat 16-04-22 17:37:50, Yu Kuai wrote: > > > Weight-raised queue is not inserted to weights_tree, which makes it > > > impossible to track how many queues have pending requests through > > > weights_tree insertion and removel. This patch add fake weight_counter > > > for weight-raised queue to do that. > > > > > > Signed-off-by: Yu Kuai > > > > This is a bit hacky. I was looking into a better place where to hook to > > count entities in a bfq_group with requests and I think bfq_add_bfqq_busy() > > and bfq_del_bfqq_busy() are ideal for this. It also makes better sense > > conceptually than hooking into weights tree handling. > > bfq_del_bfqq_busy() will be called when all the reqs in the bfqq are > dispatched, however there might still some reqs are't completed yet. > > Here what we want to track is how many bfqqs have pending reqs, > specifically if the bfqq have reqs are't complted. > > Thus I think bfq_del_bfqq_busy() is not the right place to do that. Yes, I'm aware there will be a difference. But note that bfqq can stay busy with only dispatched requests because the logic in __bfq_bfqq_expire() will not call bfq_del_bfqq_busy() if idling is needed for service guarantees. So I think using bfq_add/del_bfqq_busy() would work OK. Honza -- Jan Kara SUSE Labs, CR