Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3137129ioa; Mon, 25 Apr 2022 19:00:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqQoGeMHA7su8ym95CHXtvcvN5+MrZAOdjNreA2B+rUSHEeM6/jchps58haE4VOUncRQyo X-Received: by 2002:a17:907:7f08:b0:6f3:8c69:1779 with SMTP id qf8-20020a1709077f0800b006f38c691779mr8948941ejc.414.1650938450110; Mon, 25 Apr 2022 19:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650938450; cv=none; d=google.com; s=arc-20160816; b=rEmWJHswO55C8tEOQg9AnS1seTgMso6bOkyv9m4Qdf+XbVMHILEgtMpITa17goW7xb 4cWtTCUu6/eRjPtYX3zS7IjcbveIDcyyE2/pHwjrCaHEEabF3hdzb48KgDsgPci7fRHJ +dkNJxvL5pX8dMaa5aywfPDu3l1vxCFojq8f3S9WG5bIkqH8pqsvNkw0QQ1jHSW7yFdE mWRKo7DrFzHMG1cWnsfiggz3CQ5pNTEIY87X1gFn4QKo1SrW+sRAAH2LBONrWKHhc3xn EJkDygl4Wpy1xVpeyNKalCNvD6GExpXG2pwuDvGAA9gx8DTJxSgUffa2aWG2UZ4h9JU4 Ox2g== 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=VUB+heCNyeRFdPDI1DhMrxZcGuxVYUwZDE80GwpHJU8=; b=Japm5Jl9a7oFT+HaVarY7DsiwltaHizdme1K1PNDifILfjiH4ekgyEuGKsNnU0XEja 8uuUUCEXVUPdWAc3XrNaIvpli+H2Hl7fRzhLb5da5h2nSwJ/yoStG5B8Kq9MpymINtA2 anrpfKQJa5lATc938synH56lDyQ/kd/ARo3Zuq21a0+mY95e9MLNDEIzdBLe5je2mcyO 4GaEL5RMlYj0uQKRerdPMF+uZVkqzIlsBES3E+rj6jzPQP7t2SLqJrf7l4bjYN1Uf/3T 3n958hggZugF1J5afRTjuxEk0wzH/vAyTAkluVV5A0xjWw91i9kybs02kBjPT4Qllhlz wAlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=pdXu4C9W; dkim=neutral (no key) header.i=@suse.cz header.b=kj1ovTZo; 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 g8-20020a056402090800b00423f6b13d94si16880658edz.565.2022.04.25.19.00.24; Mon, 25 Apr 2022 19:00:50 -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=pdXu4C9W; dkim=neutral (no key) header.i=@suse.cz header.b=kj1ovTZo; 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 S239192AbiDYQar (ORCPT + 99 others); Mon, 25 Apr 2022 12:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243567AbiDYQaa (ORCPT ); Mon, 25 Apr 2022 12:30:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EC5A8A315; Mon, 25 Apr 2022 09:26:10 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9FD96210E4; Mon, 25 Apr 2022 16:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1650903968; 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=VUB+heCNyeRFdPDI1DhMrxZcGuxVYUwZDE80GwpHJU8=; b=pdXu4C9WWm9PwhxJ4kncFBH/N6LpW+See8N92WAtqIGuzAwMFB2MW2lwZkGZStmGNMJT/S Oql8ZjWpYrf8ogzL8VQ3cIPkfW8AWk8h4BuJHKGZWzp0ignZcWNfNucjWTl9vFEEoDD+tN dJo8wa5/oF7v9fgW10I9mAzX1xSkm/g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1650903968; 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=VUB+heCNyeRFdPDI1DhMrxZcGuxVYUwZDE80GwpHJU8=; b=kj1ovTZoxRmdmq25y5rwYeLhZBg+ACRAbP3a30Yt/bDVvCkDIQOoWuoBrgv7Mip8r98v41 2lUqmZqKseXVKkDg== 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 8E7412C141; Mon, 25 Apr 2022 16:26:08 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 3825DA0620; Mon, 25 Apr 2022 18:26:08 +0200 (CEST) Date: Mon, 25 Apr 2022 18:26:08 +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: <20220425162608.feya66a5amdnsr4e@quack3.lan> References: <20220416093753.3054696-1-yukuai3@huawei.com> <20220416093753.3054696-3-yukuai3@huawei.com> <20220425094856.qgkhba2klguduxot@quack3.lan> <4048cc0c-adc8-8097-4a40-762137c4c282@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4048cc0c-adc8-8097-4a40-762137c4c282@huawei.com> 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 On Mon 25-04-22 21:55:46, yukuai (C) wrote: > 在 2022/04/25 21:34, yukuai (C) 写道: > > 在 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. > > > > > Hi, > > > > 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. > > BTW, there is a counter 'dispatched' in bfqq, how about we rename it > to 'inflight', and inc when adding req to bfqq, dec the same as > 'dispatched' ? > > This way we can count bfqq when adding 'inflight' from 0 to 1, and > stop when decreasing 'inflight' from 1 to 0. Well, but 'dispatched' is used in quite a few places and it would require quite some thinking to decide which impact using 'inflight' has there... But we also have 'bfqq->entity.allocated' which is number of requests in some state associated with bfqq and we could use that. But as I wrote in my previous email, I'm not convinced it is really necessary... Honza -- Jan Kara SUSE Labs, CR