* [PATCH] blk-throttle: Remove dead check in tg_conf_updated()
@ 2026-08-20 16:05 Tang Yizhou
2026-08-21 2:45 ` Tao Cui
0 siblings, 1 reply; 2+ messages in thread
From: Tang Yizhou @ 2026-08-20 16:05 UTC (permalink / raw)
To: yukuai, tj, axboe; +Cc: linux-block, cgroups, linux-kernel, Tang Yizhou
From: Tang Yizhou <yizhou.tang@shopee.com>
The check in tg_conf_updated() was introduced for io.low, so remove it.
global ? tg->td->queue->root_blkg : tg_to_blkg(tg) was introduced in
commit 9bb67aeb9678 ("blk-throttle: respect 0 bps/iops settings for
io.low"). Remove it, too.
Fixes: bf20ab538c81 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW")
Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com>
---
block/blk-throttle.c | 18 +++++-------------
1 file changed, 5 insertions(+), 13 deletions(-)
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index ffc3b70065d4..fa742e63807d 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1267,7 +1267,7 @@ static int tg_print_conf_uint(struct seq_file *sf, void *v)
return 0;
}
-static void tg_conf_updated(struct throtl_grp *tg, bool global)
+static void tg_conf_updated(struct throtl_grp *tg)
{
struct throtl_service_queue *sq = &tg->service_queue;
struct cgroup_subsys_state *pos_css;
@@ -1286,16 +1286,8 @@ static void tg_conf_updated(struct throtl_grp *tg, bool global)
* restrictions in the whole hierarchy and allows them to bypass
* blk-throttle.
*/
- blkg_for_each_descendant_pre(blkg, pos_css,
- global ? tg->td->queue->root_blkg : tg_to_blkg(tg)) {
- struct throtl_grp *this_tg = blkg_to_tg(blkg);
-
- tg_update_has_rules(this_tg);
- /* ignore root/second level */
- if (!cgroup_subsys_on_dfl(io_cgrp_subsys) || !blkg->parent ||
- !blkg->parent->parent)
- continue;
- }
+ blkg_for_each_descendant_pre(blkg, pos_css, tg_to_blkg(tg))
+ tg_update_has_rules(blkg_to_tg(blkg));
rcu_read_unlock();
/*
@@ -1388,7 +1380,7 @@ static ssize_t tg_set_conf(struct kernfs_open_file *of,
else
*(unsigned int *)((void *)tg + of_cft(of)->private) = v;
- tg_conf_updated(tg, false);
+ tg_conf_updated(tg);
ret = 0;
unprep:
@@ -1610,7 +1602,7 @@ static ssize_t tg_set_limit(struct kernfs_open_file *of,
tg->iops[READ] = v[2];
tg->iops[WRITE] = v[3];
- tg_conf_updated(tg, false);
+ tg_conf_updated(tg);
ret = 0;
unprep:
blkg_conf_unprep(&ctx);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] blk-throttle: Remove dead check in tg_conf_updated()
2026-08-20 16:05 [PATCH] blk-throttle: Remove dead check in tg_conf_updated() Tang Yizhou
@ 2026-08-21 2:45 ` Tao Cui
0 siblings, 0 replies; 2+ messages in thread
From: Tao Cui @ 2026-08-21 2:45 UTC (permalink / raw)
To: Tang Yizhou, yukuai, tj, axboe
Cc: cui.tao, linux-block, cgroups, linux-kernel
在 2026/8/21 00:05, Tang Yizhou 写道:
> From: Tang Yizhou <yizhou.tang@shopee.com>
>
> The check in tg_conf_updated() was introduced for io.low, so remove it.
>
> global ? tg->td->queue->root_blkg : tg_to_blkg(tg) was introduced in
> commit 9bb67aeb9678 ("blk-throttle: respect 0 bps/iops settings for
> io.low"). Remove it, too.
>
> Fixes: bf20ab538c81 ("blk-throttle: remove CONFIG_BLK_DEV_THROTTLING_LOW")
> Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com>
> ---
> block/blk-throttle.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/block/blk-throttle.c b/block/blk-throttle.c
> index ffc3b70065d4..fa742e63807d 100644
> --- a/block/blk-throttle.c
> +++ b/block/blk-throttle.c
> @@ -1267,7 +1267,7 @@ static int tg_print_conf_uint(struct seq_file *sf, void *v)
> return 0;
> }
>
> -static void tg_conf_updated(struct throtl_grp *tg, bool global)
> +static void tg_conf_updated(struct throtl_grp *tg)
> {
> struct throtl_service_queue *sq = &tg->service_queue;
> struct cgroup_subsys_state *pos_css;
> @@ -1286,16 +1286,8 @@ static void tg_conf_updated(struct throtl_grp *tg, bool global)
> * restrictions in the whole hierarchy and allows them to bypass
> * blk-throttle.
> */
> - blkg_for_each_descendant_pre(blkg, pos_css,
> - global ? tg->td->queue->root_blkg : tg_to_blkg(tg)) {
> - struct throtl_grp *this_tg = blkg_to_tg(blkg);
> -
> - tg_update_has_rules(this_tg);
> - /* ignore root/second level */
> - if (!cgroup_subsys_on_dfl(io_cgrp_subsys) || !blkg->parent ||
> - !blkg->parent->parent)
> - continue;
> - }
> + blkg_for_each_descendant_pre(blkg, pos_css, tg_to_blkg(tg))
> + tg_update_has_rules(blkg_to_tg(blkg));
> rcu_read_unlock();
>
> /*
> @@ -1388,7 +1380,7 @@ static ssize_t tg_set_conf(struct kernfs_open_file *of,
> else
> *(unsigned int *)((void *)tg + of_cft(of)->private) = v;
>
> - tg_conf_updated(tg, false);
> + tg_conf_updated(tg);
> ret = 0;
>
> unprep:
> @@ -1610,7 +1602,7 @@ static ssize_t tg_set_limit(struct kernfs_open_file *of,
> tg->iops[READ] = v[2];
> tg->iops[WRITE] = v[3];
>
> - tg_conf_updated(tg, false);
> + tg_conf_updated(tg);
> ret = 0;
> unprep:
> blkg_conf_unprep(&ctx);
Reviewed-by: Tao Cui <cuitao@kylinos.cn>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-21 2:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 16:05 [PATCH] blk-throttle: Remove dead check in tg_conf_updated() Tang Yizhou
2026-08-21 2:45 ` Tao Cui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox