lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220823013810.406075-5-yukuai1@huaweicloud.com>
Date:   Tue, 23 Aug 2022 09:38:10 +0800
From:   Yu Kuai <yukuai1@...weicloud.com>
To:     tj@...nel.org, axboe@...nel.dk
Cc:     cgroups@...r.kernel.org, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org, yukuai3@...wei.com,
        yukuai1@...weicloud.com, yi.zhang@...wei.com
Subject: [PATCH 4/4] blk-throttle: cleanup throtl_dequeue_tg()

From: Yu Kuai <yukuai3@...wei.com>

Now that throtl_dequeue_tg() is called when the last bio is dispatched,
there is no need to check the flag THROTL_TG_PENDING, since it's ensured
to be set when bio is throttled.

There are no functional changes.

Signed-off-by: Yu Kuai <yukuai3@...wei.com>
---
 block/blk-throttle.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 47142a1dd102..e47506a8ef47 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -570,14 +570,11 @@ static void throtl_enqueue_tg(struct throtl_grp *tg)
 
 static void throtl_dequeue_tg(struct throtl_grp *tg)
 {
-	if (tg->flags & THROTL_TG_PENDING) {
-		struct throtl_service_queue *parent_sq =
-			tg->service_queue.parent_sq;
+	struct throtl_service_queue *parent_sq = tg->service_queue.parent_sq;
 
-		throtl_rb_erase(&tg->rb_node, parent_sq);
-		--parent_sq->nr_pending;
-		tg->flags &= ~THROTL_TG_PENDING;
-	}
+	throtl_rb_erase(&tg->rb_node, parent_sq);
+	--parent_sq->nr_pending;
+	tg->flags &= ~THROTL_TG_PENDING;
 }
 
 /* Call with queue lock held */
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ