Message ID | 20230219104309.1511562-17-shikemeng@huaweicloud.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp662045wrn; Sat, 18 Feb 2023 19:02:59 -0800 (PST) X-Google-Smtp-Source: AK7set+8DX6bSi8FUuBif75TCBcxhiJsMeqBrhMIASY0EYtXHczHyHzAjXczKCfazkuvB8vFvL8z X-Received: by 2002:a05:6a20:1585:b0:c3:18f8:6c53 with SMTP id h5-20020a056a20158500b000c318f86c53mr4918144pzj.38.1676775779454; Sat, 18 Feb 2023 19:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676775779; cv=none; d=google.com; s=arc-20160816; b=OGLrDCVMhrXb3qihi64dfyArmKuUzHmWASBbO+B9QxC5zxflaHI8fIhZQg4TTqpNCc Rqk5vGQWaVHktBlWj9DXIXjzTRWx75oVbvYFOtb00f09nbMYwDlERPZSrNunrHvR5wnD gcLN/6xw0Ib9wyp7Pvdh5eCEGXkibxAa5l7u/LhSBtVgdr3MQ9JPvhi/I5a/AtNHv8wR hDKF0K7vJ+WsTujdKVxHBawsCHt0C92s2SJOFfWx/8UJJ6tSDTyFlb/rUREAVRLH/UnD Ruk8yMEMf3JHWkaeEbAR3F+vdUhVpwWnP1edmMDE7pHH9gpSnL3XXwQoOlAW0kUiHyRf mccw== 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=WSGRZQOO0a+/0MODMKbvC6I9NQcX+PyF4lEt2xRRMOs=; b=iudo1WudCF4DFNtMj8CifIpxgUY2ecs7Q10dNY+cZ4WWtK8flkFDR4NuDqcJtp3bX3 pF10Kq7aWYFz/MjiMip4qNJPubzgBTqQS2mSpCRYgnsRe+yv7ZwStkLQMqQOOkGQi4Zp Pwa6zr7n6X0C10aQ5tu3e8oAroxi3eP5tsUKWAUzhBaGLSKQOQZ96uaMNYbL96KudecF lb4PUkopoO6dmuCJMq0OD97MUKiSkwkiTv3rPjZpY2wUUid+cqkHwJ4nVmP1V0WFPpyK ZUCy3lfn4n7s8e1EAivrERjEQsQrbyJAh/0xPWqdV6TJFcOINjWot1F2kjWXpXkegm5b QzVQ== 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 p14-20020a056a000b4e00b005941664b506si10713785pfo.224.2023.02.18.19.02.44; Sat, 18 Feb 2023 19:02:59 -0800 (PST) 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 S229759AbjBSCmB (ORCPT <rfc822;nanshango2@gmail.com> + 99 others); Sat, 18 Feb 2023 21:42:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjBSCla (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 18 Feb 2023 21:41:30 -0500 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6AFE12043; Sat, 18 Feb 2023 18:41:29 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4PK8v911Lsz4f3pBV; Sun, 19 Feb 2023 10:41:25 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP2 (Coremail) with SMTP id Syh0CgBH7utQjPFjPmleDw--.7604S18; Sun, 19 Feb 2023 10:41:27 +0800 (CST) From: Kemeng Shi <shikemeng@huaweicloud.com> To: paolo.valente@linaro.org, axboe@kernel.dk, jack@suse.cz Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, shikemeng@huaweicloud.com Subject: [PATCH 16/17] block, bfq: remove unnecessary goto tag in __bfq_weights_tree_remove Date: Sun, 19 Feb 2023 18:43:08 +0800 Message-Id: <20230219104309.1511562-17-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230219104309.1511562-1-shikemeng@huaweicloud.com> References: <20230219104309.1511562-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBH7utQjPFjPmleDw--.7604S18 X-Coremail-Antispam: 1UD129KBjvdXoWrtw4UCw15KryUJw17Kw13twb_yoWDWrg_C3 WvvrykKr4DC398Cr4xtrWaqw1DA393ZFy8GFsxGF1fuw17JasIk3s2qrZ8Jan5Xan2gFZx GrZ5tw13ZF1jkjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbqxFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r4j6ryUMIIF0xvE2Ix0cI8IcVCY1x0267AK xVW8Jr0_Cr1UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JV WxJwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7sRiVb yDUUUUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758226839943814238?= X-GMAIL-MSGID: =?utf-8?q?1758226839943814238?= |
Series |
Some bugfix and cleanup patches for bfq
|
|
Commit Message
Kemeng Shi
Feb. 19, 2023, 10:43 a.m. UTC
Do free work if num_active == 0 and remove unnecessary tag
reset_entity_pointer.
Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
block/bfq-iosched.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 6ba096e9aec6..2705a24ab146 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -976,13 +976,11 @@ void bfq_weights_tree_remove(struct bfq_queue *bfqq) root = &bfqq->bfqd->queue_weights_tree; bfqq->weight_counter->num_active--; - if (bfqq->weight_counter->num_active > 0) - goto reset_entity_pointer; - - rb_erase_cached(&bfqq->weight_counter->weights_node, root); - kfree(bfqq->weight_counter); + if (bfqq->weight_counter->num_active == 0) { + rb_erase_cached(&bfqq->weight_counter->weights_node, root); + kfree(bfqq->weight_counter); + } -reset_entity_pointer: bfqq->weight_counter = NULL; bfq_put_queue(bfqq); }