From patchwork Wed Nov 2 02:25:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13990 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3337298wru; Tue, 1 Nov 2022 19:05:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5yJrIZg7HMoyg2Lkr7gLvit4Ily4V4qiey8Ro8eLSpZ7g0N2upsvuIakaLQCU6WBIJ/rSB X-Received: by 2002:a17:90b:3901:b0:213:dfd5:a75f with SMTP id ob1-20020a17090b390100b00213dfd5a75fmr14167090pjb.233.1667354742792; Tue, 01 Nov 2022 19:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667354742; cv=none; d=google.com; s=arc-20160816; b=JI60EcV+MeDHYETt89MG6b49AIT2HaOQ/sF1SFymZF583pulCFUvKJGDY+D3L+Ke2u UIViztkG7s8V74oYUkRDFAzt6teLEJMNN69aBt5wSlob/PTpHJaXdROM/9crbzLS1nIn 3luUdbjtGl5Qv6KM90kyXKmxR9l+jQIvG7K7VME32yp7OAAXhXGcqYQ9tGq/0pRl3J+F 7wshgb7/5m1a40bEunwZCIyPLQupXeROpPNJzYk/RIA6rqe5USRr2fDhpZWHxeDPyXeA dSECDeKs0fFGvQskONZZaz0fNeimjqa2anHfmcnLY/VzcwVMH+5CKbXJ07jfw2YE6xpD OQfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MFncMCCokAmu+KRHAMeazFOoTbXO+qyPcxDCvK8OrXo=; b=a/gij78ile10eWSs4TIhRD5AIvjwVz5U1PNSFL4HfOIr8priCvsz1wdy8uYJ80VOfW HIicGxSnICD9CVV4DVj/PdWAqdkAZmvNxVxkyF7/YLf+206P4wWsNW3I96r8R6nBhfnS bp75EoeDXZ34+T5qed0k3LloZ2SqSglERQP81MZ7nDmtBomZoG6qhrc9A/LzNJnY+RDJ sHFD1VF+FPFP5mDgWhvKWXD+k1VkY3NX9dX2b1ddhX/+/AYPZoVcfr/8M8MefhgKJXH2 pf52wvYrlgHMTF74ml8xFijG9niX4fuf1vOilQMlEHj8tUCV7RDBTArAdqUB2E3LGvvS BlVw== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mm24-20020a17090b359800b0020da8f11bb3si608347pjb.14.2022.11.01.19.05.29; Tue, 01 Nov 2022 19:05:42 -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; 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 S230073AbiKBCEF (ORCPT + 99 others); Tue, 1 Nov 2022 22:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbiKBCED (ORCPT ); Tue, 1 Nov 2022 22:04:03 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D4C618B0C; Tue, 1 Nov 2022 19:04:01 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4N299K2sS2zKFQh; Wed, 2 Nov 2022 10:01:25 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgCnP9QN0GFjGqzfBA--.48110S5; Wed, 02 Nov 2022 10:03:59 +0800 (CST) From: Yu Kuai To: jack@suse.cz, axboe@kernel.dk, paolo.valente@linaro.org Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next v4 1/5] block, bfq: remove set but not used variable in __bfq_entity_update_weight_prio Date: Wed, 2 Nov 2022 10:25:38 +0800 Message-Id: <20221102022542.3621219-2-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221102022542.3621219-1-yukuai1@huaweicloud.com> References: <20221102022542.3621219-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgCnP9QN0GFjGqzfBA--.48110S5 X-Coremail-Antispam: 1UD129KBjvdXoW7XF18Kw48JrWDJr1DAr4fXwb_yoWkGwcEya 4Dt3WrGr1kJ3yrCF1jyr13Xayqq3yjq34DZa4ftrW8JF17Jas2k39FyrZxZws5WFWrGFyf Zwn5Xw43AF1jvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb-kFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY02 0Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM2 8EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AI xVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20x vE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xv r2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbec_DUUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748348166510847568?= X-GMAIL-MSGID: =?utf-8?q?1748348166510847568?= From: Yu Kuai After the patch "block, bfq: cleanup bfq_weights_tree add/remove apis"), the local variable 'bfqd' is not used anymore, thus remove it. Signed-off-by: Yu Kuai --- block/bfq-wf2q.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c index 5a02cb94d86e..2faa29fcb1e9 100644 --- a/block/bfq-wf2q.c +++ b/block/bfq-wf2q.c @@ -706,21 +706,6 @@ __bfq_entity_update_weight_prio(struct bfq_service_tree *old_st, if (entity->prio_changed) { struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity); unsigned int prev_weight, new_weight; - struct bfq_data *bfqd = NULL; -#ifdef CONFIG_BFQ_GROUP_IOSCHED - struct bfq_sched_data *sd; - struct bfq_group *bfqg; -#endif - - if (bfqq) - bfqd = bfqq->bfqd; -#ifdef CONFIG_BFQ_GROUP_IOSCHED - else { - sd = entity->my_sched_data; - bfqg = container_of(sd, struct bfq_group, sched_data); - bfqd = (struct bfq_data *)bfqg->bfqd; - } -#endif /* Matches the smp_wmb() in bfq_group_set_weight. */ smp_rmb(); From patchwork Wed Nov 2 02:25:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13986 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3337001wru; Tue, 1 Nov 2022 19:05:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6WzARmDnXlshnNBIpHSqmN4YI4/CI7VhFaudxBPolvg1+VJhZH0gIOqgcxenrY6GwstA58 X-Received: by 2002:a17:90a:df04:b0:213:1cf1:435d with SMTP id gp4-20020a17090adf0400b002131cf1435dmr23681565pjb.210.1667354707109; Tue, 01 Nov 2022 19:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667354707; cv=none; d=google.com; s=arc-20160816; b=IzPqjWCJoqLPAZZbuUDsYQGRUmnPeNkcVcE5TI3vVTBkYXO+JMKBx81WXppqzoOd3x ADrsE9M1+OQdxCX5dKVbb9uTJkSVPhZHMTYi0tA3BITpNIF/vXIGF+YoJVC6IAcCZZcC UJLoIk49swCN5BIfbyHSsboc+KYzvcq5N6l7mZlyPASFrImRA/RY/InYKQrNxl/opmbv W3/RVgCMskFPSFfobHEBMR8kMnYj3te6nhbqNORL0o4FHC41mlV9OP1bhG0XLnnvyI+3 u6B1kPi4/o6/rjkk38If7NCAusJs98lA5f1udNSwl+HG9cmFkidROJ6Oy12U8knS8gCK 93lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NFZh/glCQVJd4cNI3Nu5wc/cnKBDMvHNPS9WndSLuWc=; b=Dcj9PfRDH6owJHXlaxTaZPPpjVdiM16eW60fwZfa1lha25Ip5sU1Sw7XMdSMdzRGQw CDEZQBbbIWnYh54iWQOtYp+Ge3+aKYpc3D6Gb4w9knpULbxqNZTNEKPKDHc6xf7SF9lR HHOuTRwMjLp/vfH6F3D392+8SeWoPmRoiZ0do9DHNdeOBtZFX85cPBmCcKyKmmK8PrMr Fmy9QrGD5mgcTnFFgcY8Wy19usBu14mCdA1ua80LMnkUHdBD5PM+6er5zahbrbLGpJXZ vbDA6zSzZY80+2dpLNN/HI0fjkoyrhVgrTG9W8TusRgCgBlqNz+lZ1SlsBj+WiPofOJb B0aQ== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a17090340c600b001869b2c5f47si13428560pld.326.2022.11.01.19.04.53; Tue, 01 Nov 2022 19:05:07 -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; 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 S230174AbiKBCER (ORCPT + 99 others); Tue, 1 Nov 2022 22:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbiKBCEE (ORCPT ); Tue, 1 Nov 2022 22:04:04 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A1B665C5; Tue, 1 Nov 2022 19:04:01 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4N299M5C3jz6R5KZ; Wed, 2 Nov 2022 10:01:27 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgCnP9QN0GFjGqzfBA--.48110S6; Wed, 02 Nov 2022 10:04:00 +0800 (CST) From: Yu Kuai To: jack@suse.cz, axboe@kernel.dk, paolo.valente@linaro.org Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next v4 2/5] block, bfq: factor out code to update 'active_entities' Date: Wed, 2 Nov 2022 10:25:39 +0800 Message-Id: <20221102022542.3621219-3-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221102022542.3621219-1-yukuai1@huaweicloud.com> References: <20221102022542.3621219-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgCnP9QN0GFjGqzfBA--.48110S6 X-Coremail-Antispam: 1UD129KBjvJXoWxAw1UWw17tr4DWF4xZF1xAFb_yoW5tF4fp3 Zxtw1UXr48JrnxWrWYy3W8Zr95Krn3C34ktF92v34rJF12krnFq3ZIy3WFvFy09rZ8XF13 AFyqqry8uF47JrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2 x26xkF7I0E14v26r4j6ryUM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUc6pPUUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748348129317980567?= X-GMAIL-MSGID: =?utf-8?q?1748348129317980567?= From: Yu Kuai Current code is a bit ugly and hard to read. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Acked-by: Paolo Valente --- block/bfq-wf2q.c | 61 +++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c index 2faa29fcb1e9..a908aa3eb0ab 100644 --- a/block/bfq-wf2q.c +++ b/block/bfq-wf2q.c @@ -218,6 +218,26 @@ static bool bfq_no_longer_next_in_service(struct bfq_entity *entity) return false; } +static void bfq_inc_active_entities(struct bfq_entity *entity) +{ + struct bfq_sched_data *sd = entity->sched_data; + struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data); + struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd; + + if (bfqg != bfqd->root_group) + bfqg->active_entities++; +} + +static void bfq_dec_active_entities(struct bfq_entity *entity) +{ + struct bfq_sched_data *sd = entity->sched_data; + struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data); + struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd; + + if (bfqg != bfqd->root_group) + bfqg->active_entities--; +} + #else /* CONFIG_BFQ_GROUP_IOSCHED */ static bool bfq_update_parent_budget(struct bfq_entity *next_in_service) @@ -230,6 +250,14 @@ static bool bfq_no_longer_next_in_service(struct bfq_entity *entity) return true; } +static void bfq_inc_active_entities(struct bfq_entity *entity) +{ +} + +static void bfq_dec_active_entities(struct bfq_entity *entity) +{ +} + #endif /* CONFIG_BFQ_GROUP_IOSCHED */ /* @@ -456,11 +484,6 @@ static void bfq_active_insert(struct bfq_service_tree *st, { struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity); struct rb_node *node = &entity->rb_node; -#ifdef CONFIG_BFQ_GROUP_IOSCHED - struct bfq_sched_data *sd = NULL; - struct bfq_group *bfqg = NULL; - struct bfq_data *bfqd = NULL; -#endif bfq_insert(&st->active, entity); @@ -471,17 +494,10 @@ static void bfq_active_insert(struct bfq_service_tree *st, bfq_update_active_tree(node); -#ifdef CONFIG_BFQ_GROUP_IOSCHED - sd = entity->sched_data; - bfqg = container_of(sd, struct bfq_group, sched_data); - bfqd = (struct bfq_data *)bfqg->bfqd; -#endif if (bfqq) list_add(&bfqq->bfqq_list, &bfqq->bfqd->active_list); -#ifdef CONFIG_BFQ_GROUP_IOSCHED - if (bfqg != bfqd->root_group) - bfqg->active_entities++; -#endif + + bfq_inc_active_entities(entity); } /** @@ -558,29 +574,16 @@ static void bfq_active_extract(struct bfq_service_tree *st, { struct bfq_queue *bfqq = bfq_entity_to_bfqq(entity); struct rb_node *node; -#ifdef CONFIG_BFQ_GROUP_IOSCHED - struct bfq_sched_data *sd = NULL; - struct bfq_group *bfqg = NULL; - struct bfq_data *bfqd = NULL; -#endif node = bfq_find_deepest(&entity->rb_node); bfq_extract(&st->active, entity); if (node) bfq_update_active_tree(node); - -#ifdef CONFIG_BFQ_GROUP_IOSCHED - sd = entity->sched_data; - bfqg = container_of(sd, struct bfq_group, sched_data); - bfqd = (struct bfq_data *)bfqg->bfqd; -#endif if (bfqq) list_del(&bfqq->bfqq_list); -#ifdef CONFIG_BFQ_GROUP_IOSCHED - if (bfqg != bfqd->root_group) - bfqg->active_entities--; -#endif + + bfq_dec_active_entities(entity); } /** From patchwork Wed Nov 2 02:25:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13987 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3337004wru; Tue, 1 Nov 2022 19:05:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gGf3bSLfFu63IZiJf0G608MPgCnjn7eFr8NItABjZC8qsaOk+HVKlao+kwhO1EepqYP9L X-Received: by 2002:a17:902:bcc4:b0:181:899a:ac9c with SMTP id o4-20020a170902bcc400b00181899aac9cmr22369146pls.124.1667354707194; Tue, 01 Nov 2022 19:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667354707; cv=none; d=google.com; s=arc-20160816; b=kuWY2WrohYBuhXx99ket81jQJFUR7tFEloVPTwLtbH9H5HJ9oR5vSyekmv/8JKuxB2 e7Dq/cNXPXd23JIa3jiIIgn7bPTCUl0Par2oVVMRSDMRf4wonEqlnW/WC7c8Wjdvz5Op uH6txatG3nWKO2gNTWMGjpHaVr3iDV/dnSrP4/RLO2Nz8MnDheX5lVaq+UK2qpZ3uxpV dvgeMW6fkaOaMAMn9YPGWv3LzLAddRbAbR3cdgzW6ZKW3S8yUNy/j1bRPDFJGs+8Ff6J 5bI6VJgKqDC6PlhaYIa+Xms6W4GEmUA8iS5l8wl0y2oCLWU/2/HE2O/Jb0IywDTgdCrP qL5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=P0zkYto3ccg0cgP6mFqoR3gcW0Bj831/9migAeRSSAo=; b=pVPe0RVjPUYiJc0+UNcrbgFwG2wy/Hhu1qEjSdHCoLgzhKQJkRZibLlH5yOyImhzJE 3geydwEvwJYYBD7HKKOAX/SZpltfnXy4ByIkMBQdjrSZH/e4KSC5ZpW344Dp0+3Qyv54 /D2NeuYzWzKBshukuietadhqRIgSL0TVSOS81gqgsoEQzbRUB+XcDhymW/UlV5cr1ks7 MwDQeHatPCuydGaX2pbDNU7rIhZFfUaZM0XK0Q1l5oX4ZDY7EndyZ5Iah5cqZ1qY9fQg mMmDKmhrttL8NDVHcEC/hzgQ39m01ODS1LM8BeZBQugCH32+jzhgWQxNxm6uhTVmYumX GHCQ== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e13-20020a6558cd000000b0046f33e0f911si13859538pgu.563.2022.11.01.19.04.53; Tue, 01 Nov 2022 19:05:07 -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; 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 S229875AbiKBCEO (ORCPT + 99 others); Tue, 1 Nov 2022 22:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbiKBCED (ORCPT ); Tue, 1 Nov 2022 22:04:03 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A390186E1; Tue, 1 Nov 2022 19:04:02 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4N299L1f5pzKF2w; Wed, 2 Nov 2022 10:01:26 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgCnP9QN0GFjGqzfBA--.48110S7; Wed, 02 Nov 2022 10:04:00 +0800 (CST) From: Yu Kuai To: jack@suse.cz, axboe@kernel.dk, paolo.valente@linaro.org Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next v4 3/5] block, bfq: cleanup bfq_activate_requeue_entity() Date: Wed, 2 Nov 2022 10:25:40 +0800 Message-Id: <20221102022542.3621219-4-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221102022542.3621219-1-yukuai1@huaweicloud.com> References: <20221102022542.3621219-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgCnP9QN0GFjGqzfBA--.48110S7 X-Coremail-Antispam: 1UD129KBjvJXoW7KF48CryDKrWftryrZrWkJFb_yoW8WFyrpF ZIkr409r40gF13GFW3X3WUXrWfW3s3A3y3JFnrJw1fJr12krnYqanI9F1SqFy0k393CF15 Z34jq3y8XF4UJrJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9m14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JrWl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrwCFx2 IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v2 6r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67 AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IY s7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr 0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUd8n5UUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748348129261204972?= X-GMAIL-MSGID: =?utf-8?q?1748348129261204972?= From: Yu Kuai Just make the code a litter cleaner by removing the unnecessary variable 'sd'. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Acked-by: Paolo Valente --- block/bfq-wf2q.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c index a908aa3eb0ab..4d4b84e7bf3e 100644 --- a/block/bfq-wf2q.c +++ b/block/bfq-wf2q.c @@ -1052,12 +1052,12 @@ static void __bfq_requeue_entity(struct bfq_entity *entity) } static void __bfq_activate_requeue_entity(struct bfq_entity *entity, - struct bfq_sched_data *sd, bool non_blocking_wait_rq) { struct bfq_service_tree *st = bfq_entity_service_tree(entity); - if (sd->in_service_entity == entity || entity->tree == &st->active) + if (entity->sched_data->in_service_entity == entity || + entity->tree == &st->active) /* * in service or already queued on the active tree, * requeue or reposition @@ -1089,14 +1089,10 @@ static void bfq_activate_requeue_entity(struct bfq_entity *entity, bool non_blocking_wait_rq, bool requeue, bool expiration) { - struct bfq_sched_data *sd; - for_each_entity(entity) { - sd = entity->sched_data; - __bfq_activate_requeue_entity(entity, sd, non_blocking_wait_rq); - - if (!bfq_update_next_in_service(sd, entity, expiration) && - !requeue) + __bfq_activate_requeue_entity(entity, non_blocking_wait_rq); + if (!bfq_update_next_in_service(entity->sched_data, entity, + expiration) && !requeue) break; } } From patchwork Wed Nov 2 02:25:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13985 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3336881wru; Tue, 1 Nov 2022 19:04:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6B2AFNOY5UjnbXaW/uQuUmza/lVg/TdmqnD6VcU2OlBimARckDjTPtyj/lTwN98FzMl2M1 X-Received: by 2002:a17:90b:2705:b0:20a:b25d:5d93 with SMTP id px5-20020a17090b270500b0020ab25d5d93mr40566221pjb.218.1667354694072; Tue, 01 Nov 2022 19:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667354694; cv=none; d=google.com; s=arc-20160816; b=x+Mz5sQTdu3DOz8jFWyyBQvv0xEBLQByKukC4pALq/tWzn0ETV3VyZyT3B7UWaY+UA bKrnJZEG7oJrQQ+T7PQEh6XoJHjstYbeiW/O4aaLUva6OrmCPqboIvAMsMSbQdMhZ27Q 0FXosAL+l/AmscEJqmiJeByvw9XO6Tf9uNpZmrejeFBdt9SVEx4/2xBu11F+gimiRaF/ H95yNGXvZiFSd8oJTtG4G4YPvU0Vug+WShz2b1vnRs5+faq0C1VjeMCWe8QwOA+15SQI t4jwwlRsrskgKqIvrlqEvtcwDr/7fYmudghnkSLtziXRpDIzAgztNPBiNkKZdKdeLjzP KE5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=3UJuRz9MrdK9E9cArDJI3ajwhMWLG+OT9AaCE9NInMc=; b=NY0pHBSwsxxIU4RTgQOZ0cDJuTQhOLD+dCqN+LrlBw+2gJyvBRfETDye/tLsySsVgO fSsUGKG54ZCjedkUHVhY7HMTpGV6jP5Sbt4JGRSeOUZ3vXNjypYfo/Gl1b/NhT1XiEdK opif/8QdtnE1ktAmFxLlRJ/oHIDNiHNVY5FoGJOC07F3s9ilcHZsCJZXqM42rB93WSc3 IPj4VRHKAThZajo2PqIrMXVE9jOW740vOLA9YE+1DGIHrTy8JcmeqMT64ehGNKRKD2Kd u4vhIutnNaqFjfdwVItc5oAb3spRuyC+WrZLAZhB5nqryn7Zr0MAlDvajn98WsikFgG+ pkcA== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e18-20020a170903241200b001784c98bfddsi15023645plo.24.2022.11.01.19.04.41; Tue, 01 Nov 2022 19:04:54 -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; 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 S229929AbiKBCEL (ORCPT + 99 others); Tue, 1 Nov 2022 22:04:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbiKBCED (ORCPT ); Tue, 1 Nov 2022 22:04:03 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A05318B0D; Tue, 1 Nov 2022 19:04:02 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4N299n4HcJzl4Gh; Wed, 2 Nov 2022 10:01:49 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgCnP9QN0GFjGqzfBA--.48110S8; Wed, 02 Nov 2022 10:04:00 +0800 (CST) From: Yu Kuai To: jack@suse.cz, axboe@kernel.dk, paolo.valente@linaro.org Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next v4 4/5] block, bfq: remove dead code for updating 'rq_in_driver' Date: Wed, 2 Nov 2022 10:25:41 +0800 Message-Id: <20221102022542.3621219-5-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221102022542.3621219-1-yukuai1@huaweicloud.com> References: <20221102022542.3621219-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgCnP9QN0GFjGqzfBA--.48110S8 X-Coremail-Antispam: 1UD129KBjvdXoW7GF1xJFyfur4xGr4fJrWUArb_yoWkWrc_Ka 4SkF97ZryrArW3ur45JF1Yqa4vva1fW3WDAFn8Krs5uF4ag3ZaywnFqr4a9FZrX397G3Wf twn0q3W3Jrn0vjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbTxFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2 IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28E F7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr 1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0D M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx v20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxAIw28IcxkI7VAKI48JMx C20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAF wI0_JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20x vE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v2 0xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxV W8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbmZX7UUUUU== X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748348115346523173?= X-GMAIL-MSGID: =?utf-8?q?1748348115346523173?= From: Yu Kuai Such code are not even compiled since they are inside marco "#if 0". Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Acked-by: Paolo Valente --- block/bfq-iosched.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 42aa5fc7f17b..2381cf220ba2 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -2321,22 +2321,6 @@ static sector_t get_sdist(sector_t last_pos, struct request *rq) return 0; } -#if 0 /* Still not clear if we can do without next two functions */ -static void bfq_activate_request(struct request_queue *q, struct request *rq) -{ - struct bfq_data *bfqd = q->elevator->elevator_data; - - bfqd->rq_in_driver++; -} - -static void bfq_deactivate_request(struct request_queue *q, struct request *rq) -{ - struct bfq_data *bfqd = q->elevator->elevator_data; - - bfqd->rq_in_driver--; -} -#endif - static void bfq_remove_request(struct request_queue *q, struct request *rq) { From patchwork Wed Nov 2 02:25:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Kuai X-Patchwork-Id: 13988 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3337068wru; Tue, 1 Nov 2022 19:05:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM54+m4AOImYSv4j+CnkJsVg3yrm/gKFfVy/lJYT9IqVDA812lBdkcjiu3coblRCT7W7bzKK X-Received: by 2002:a17:903:1c6:b0:185:47ce:f4f0 with SMTP id e6-20020a17090301c600b0018547cef4f0mr22911591plh.132.1667354713051; Tue, 01 Nov 2022 19:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667354713; cv=none; d=google.com; s=arc-20160816; b=VhZcCLmLxPj1VerXPV2vL0hgCFg88hoolV+BzO1sS3vptgTxA9SC7Q3w4lg4SkWtqX n4ADQFci+gEnAm6TbUuoyai1Yjof2H/gS8bYyfErZJQvTdXDv0DMUIsMt6g/yd/Kbwjg /o92Jb32FSfdAIa5tA3w63fyMirEi7H+A0L7YGLg9A82CkX/uPijl5JKi0X77vO3xOs5 dlmtwcX/PKRYGnTq04gQfifPpIrlS+2zjVRz/F+WMHlmJ4XS990ws1M3NeSf1hBswH35 UDczZva7VHxIS0IZ3HmR3xXvTaEbx9YceFPQ9I08zFBpSCbrSAXMt9ewxt25SsIO+1f1 WvfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lTNPuNAP/7m69gckO6XS80HGqdWfT/pnX6zz3g4v7Xo=; b=h0VvlTjSrWSFdPqkoaXMhb6uRRZKW6qFE95ZrNOCFIJ52fJcrn7N/+Q/5fHque0n3y C4v2vaF8W/kgJdQSf9v1Wb7TNonQ8D7TEkfCAh8B2sJRHgLiDaoi57VVtzh+fPZmCrK9 VlXzG60FMEzG6vVdAn/bVHKapk8glrpQr/b4GmyllFIoK4rZqle9NfuyN6bLPXfPnwna GCpvHyxG6pUO007kP7xRLwg7r36pF8J2Q+mhpXsl+oOoyPe3DwKSnENYgiDEQ+nEC1Cn dd6c2CUYM0mrSm4vi6rbt2piFruUwACKWDazhEN9WspsHGWlmFURGqd2QrEpP712fBwc j7PA== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o13-20020a170902d4cd00b0017145b821d2si14526724plg.477.2022.11.01.19.05.00; Tue, 01 Nov 2022 19:05:13 -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; 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 S230143AbiKBCEU (ORCPT + 99 others); Tue, 1 Nov 2022 22:04:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbiKBCED (ORCPT ); Tue, 1 Nov 2022 22:04:03 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D679A186C9; Tue, 1 Nov 2022 19:04:02 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4N299p0BQBzl21b; Wed, 2 Nov 2022 10:01:50 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgCnP9QN0GFjGqzfBA--.48110S9; Wed, 02 Nov 2022 10:04:01 +0800 (CST) From: Yu Kuai To: jack@suse.cz, axboe@kernel.dk, paolo.valente@linaro.org Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [PATCH -next v4 5/5] block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group Date: Wed, 2 Nov 2022 10:25:42 +0800 Message-Id: <20221102022542.3621219-6-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221102022542.3621219-1-yukuai1@huaweicloud.com> References: <20221102022542.3621219-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 X-CM-TRANSID: Syh0CgCnP9QN0GFjGqzfBA--.48110S9 X-Coremail-Antispam: 1UD129KBjvJXoW7Kw4UAFy5Wr47Gw4UCr45ZFb_yoW8tw43p3 ZIq3WDWrWftrn3Wr4UA3Wjqr93twn3C34DKa4kX34avFy7trnFqan0yw18Z3W09FZxCrsr Z34j93ykZr17twUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9K14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F 4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq 3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7 IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U M4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0EwIxGrw CFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE 14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2 IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK8VAv wI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14 v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjfUOBTYUUUUU X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748348135202596213?= X-GMAIL-MSGID: =?utf-8?q?1748348135202596213?= From: Yu Kuai Prevent unnecessary format conversion for bfqg->bfqd in multiple places. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara Acked-by: Paolo Valente --- block/bfq-cgroup.c | 2 +- block/bfq-iosched.h | 2 +- block/bfq-wf2q.c | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c index 4c37398e0b99..d57872cc05ed 100644 --- a/block/bfq-cgroup.c +++ b/block/bfq-cgroup.c @@ -224,7 +224,7 @@ void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq, { blkg_rwstat_add(&bfqg->stats.queued, opf, 1); bfqg_stats_end_empty_time(&bfqg->stats); - if (!(bfqq == ((struct bfq_data *)bfqg->bfqd)->in_service_queue)) + if (!(bfqq == bfqg->bfqd->in_service_queue)) bfqg_stats_set_start_group_wait_time(bfqg, bfqq_group(bfqq)); } diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h index 76363841d8ff..9fa89577322d 100644 --- a/block/bfq-iosched.h +++ b/block/bfq-iosched.h @@ -931,7 +931,7 @@ struct bfq_group { struct bfq_entity entity; struct bfq_sched_data sched_data; - void *bfqd; + struct bfq_data *bfqd; struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS]; struct bfq_queue *async_idle_bfqq; diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c index 4d4b84e7bf3e..b02b53658ed4 100644 --- a/block/bfq-wf2q.c +++ b/block/bfq-wf2q.c @@ -222,9 +222,8 @@ static void bfq_inc_active_entities(struct bfq_entity *entity) { struct bfq_sched_data *sd = entity->sched_data; struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data); - struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd; - if (bfqg != bfqd->root_group) + if (bfqg != bfqg->bfqd->root_group) bfqg->active_entities++; } @@ -232,9 +231,8 @@ static void bfq_dec_active_entities(struct bfq_entity *entity) { struct bfq_sched_data *sd = entity->sched_data; struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data); - struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd; - if (bfqg != bfqd->root_group) + if (bfqg != bfqg->bfqd->root_group) bfqg->active_entities--; }