Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2371761ioo; Sat, 28 May 2022 11:34:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrt7oY5UlcAbVKF1E+YMRS0+w3TdZuqWZJwimMFA1und3KhYfFB4zwMJUuUrjsvjaAJbWy X-Received: by 2002:a17:902:ce8f:b0:163:cc85:ba89 with SMTP id f15-20020a170902ce8f00b00163cc85ba89mr18716plg.79.1653762881342; Sat, 28 May 2022 11:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653762881; cv=none; d=google.com; s=arc-20160816; b=Y6blSrZ67ThDgZJP2JnWo/UDOXFIO/eZy5vUwFXcEwBFTqJL0rDD3rpKgBDu9uJvK0 +yWUCZFnpT7ZaBUY+vEoqsHYXbh1hIYTSJkZo36RcmVn18eSe2FKOwTairBDXt3OMvWR W+Oq4CIPG3CE60jXhnGqxAsBYy7mhJZ+6AQ1LhhAitNxY0Sx3EPCJc//fXM7uWtWkFGb unVv/0rdk+UcHuF9NPPd+51qC7jlj6Jyh2N4neHyffkQcvDrt6nYi2L0Pr6zsdi6AwVS YSuus7pyQPxX4jqIiI56p9/U1lQom21HXVLWnyHuaSamMoluxQaS+VDcpnofPns0z6+4 1qhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=dDoLuYfmUzmNl8rahH4p8ju7i+BGwcHFXdOAPFyUudI=; b=r7LXQeiAVeHV85KFAg5B5V/aRUPUOWKOIEOGXHwhRQfEWH2JPgw2N8ri5CrFcSOlVh 7rte5VFw0QxKyGz4UgrFZXOr55hXkjUvrIUJGFQYGImruNXWegCi9fkXsLNO/kBaM4dD 2WnMtnJX3e8R0ZLxBazy+swlDvWOHg5xILorEtQeCDICOhiuDBykT+GmGuo03Wu5q4t5 cD2Gxj/vKjavg5Gsvo2Lptdigb2RzGbaDc0RfVUiuVRftUhJ5xzCv/gDvbo/JJtq8y/c wwX68OYfnOeBv6Rqzx96WkpjbqxeYtFrVg224wcZACbTXwkiV+tYbeQM6BqJ+EFmOqHX 6w5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 196-20020a6216cd000000b0050a96ba4e5esi8611576pfw.290.2022.05.28.11.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 11:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EF743245AE; Sat, 28 May 2022 11:30:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231793AbiE1IhO (ORCPT + 99 others); Sat, 28 May 2022 04:37:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiE1IhN (ORCPT ); Sat, 28 May 2022 04:37:13 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 186FD19012; Sat, 28 May 2022 01:37:11 -0700 (PDT) Received: from kwepemi100004.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4L9FPd30RSzjX8C; Sat, 28 May 2022 16:36:05 +0800 (CST) Received: from kwepemm600009.china.huawei.com (7.193.23.164) by kwepemi100004.china.huawei.com (7.221.188.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 16:37:09 +0800 Received: from [10.174.176.73] (10.174.176.73) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 16:37:08 +0800 Subject: Re: [PATCH -next v6 1/3] block, bfq: record how many queues are busy in bfq_group To: Paolo Valente CC: Jan Kara , Tejun Heo , Jens Axboe , , linux-block , LKML , References: <20220523131818.2798712-1-yukuai3@huawei.com> <20220523131818.2798712-2-yukuai3@huawei.com> <8D29A46A-4B8A-4F05-BCE3-D9D0F0D2DD5A@linaro.org> From: Yu Kuai Message-ID: <7628f927-7131-5e7f-33d9-6029dada57fe@huawei.com> Date: Sat, 28 May 2022 16:37:07 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <8D29A46A-4B8A-4F05-BCE3-D9D0F0D2DD5A@linaro.org> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.73] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, 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 ?? 2022/05/28 16:18, Paolo Valente ะด??: > >> /* >> @@ -1660,6 +1678,7 @@ void bfq_del_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq, >> bfq_clear_bfqq_busy(bfqq); >> >> bfqd->busy_queues[bfqq->ioprio_class - 1]--; >> + bfq_inc_busy_queues(bfqq); >> > > Why do you increment the number of busy queues for the group on a > del_bfqq_busy, instead of an add_bfqq_busy? Hi, Paolo You'are right, here should be bfq_dec_busy_queues()... > > Besides, the name of the function bfq_inc_busy_queues does not mention > the target of the update, namely the group. This creates a little > confusion at a first sight, as one sees this function invoked right > after the update of a field with the same name: bfqd->busy_queues. Ok, that make sense, I'll move the update of 'bfqd->busy_queues' into the new api as well. Thanks, Kuai > >> if (bfqq->wr_coeff > 1) >> bfqd->wr_busy_queues--; >> @@ -1683,6 +1702,7 @@ void bfq_add_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq) >> >> bfq_mark_bfqq_busy(bfqq); >> bfqd->busy_queues[bfqq->ioprio_class - 1]++; >> + bfq_dec_busy_queues(bfqq); > > Same pair of comments as above. > > Thanks, > Paolo > >> >> if (!bfqq->dispatched) >> if (bfqq->wr_coeff == 1) >> -- >> 2.31.1 >> > > . >