Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3528401ioa; Tue, 26 Apr 2022 05:29:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIzSDFJAcJNK/gxU1PU9gID83Zl8yLwCEioFDwu9QUHDwTowmgBfVYJ5drHGZoQnIRBteN X-Received: by 2002:a17:906:52c7:b0:6ce:a880:50a3 with SMTP id w7-20020a17090652c700b006cea88050a3mr20728836ejn.437.1650976146825; Tue, 26 Apr 2022 05:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650976146; cv=none; d=google.com; s=arc-20160816; b=KtTGRUZiupCAMzbiZ97hJWHvTM+XLNdvdBJGMTtHJfYL0WOUCYBpu0YlV46GTzWWEV HAn7M7IADVOjDwq1iIRGfH2YjvqBAWLRJhyhrCYgzFc0aH9Dyrftm9Ia30/ClIvNelJv itV9pzadfOAMxqIwgj7YK1JYvPVqVumZx7gAAo4AVM9cz808/Cn1ZrlPkpJZBgQd8w7i sGekB19EhGfgom+4jo4Tc7rD8poGwR7+bmKx6qgoNjPyyr5JRXMXJKHntYO0kSRFjdN2 wh+qSrl5USeFmcFnuTxhUkc+v4VBQm10BWuGuf3Zl0so5VoQgd1Tca7GQ0tL8csNrLNM 4UNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=bIwwrsg+enqFDb2rJvlESBhPlFgt7kfPl8/6sFp+bG0=; b=NZwSK3k5bpHFy/eCDKeGAnZciDJmItyXERrtAEeRDdg8NVtl7vpMGZc3/KvHxR7dfq DQNQJ5QdpzhARqiZMQl21qv6cK0WnwIZM7FswN+3366uoB8nq0GBg4em/h0Hor6dgNqt zPVZRSdvnYhtcLubdWOOfk4nIymBaFAR0n+94nYpSBdhciCdxYMsSAjt7e/fUpJU/JeF FMWH7zPCfmBtkEdL5avvgEgWeOM+KD8Fh3lo5aG06RPnNwYBGRnSAje35pe0UNvGghNa UPLzUOjnyf7Kz1sYPLx5OlixPu6gSIsvIBUXliYprV7ZD3bfxzsV+ar1gazD+vI20Ws4 zNWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=sRbvsAni; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a0564020e8c00b00425d3d8afe2si7344512eda.106.2022.04.26.05.28.40; Tue, 26 Apr 2022 05:29:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=sRbvsAni; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243310AbiDYQUB (ORCPT + 99 others); Mon, 25 Apr 2022 12:20:01 -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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 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