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; } }