Commit c9b0ad23 authored by Yu Kuai's avatar Yu Kuai Committed by Zheng Zengkai
Browse files

blk-throttle: don't check whether or not lower limit is valid if...

blk-throttle: don't check whether or not lower limit is valid if CONFIG_BLK_DEV_THROTTLING_LOW is off

mainline inclusion
from mainline-v5.11-rc1
commit acaf523a
category: bugfix
bugzilla: 185789 https://gitee.com/openeuler/kernel/issues/I4DDEL
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=acaf523a7bf226b28504306c1cfee194520123b3



---------------------------

blk_throtl_update_limit_valid() will search for descendants to see if
'LIMIT_LOW' of bps/iops and READ/WRITE is nonzero. However, they're always
zero if CONFIG_BLK_DEV_THROTTLING_LOW is not set, furthermore, a lot of
time will be wasted to iterate descendants.

Thus do nothing in blk_throtl_update_limit_valid() in such situation.

Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Reviewed-by: default avatarYufen Yu <yuyufen@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2ffb13b9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -591,6 +591,7 @@ static void throtl_pd_online(struct blkg_policy_data *pd)
	tg_update_has_rules(tg);
}

#ifdef CONFIG_BLK_DEV_THROTTLING_LOW
static void blk_throtl_update_limit_valid(struct throtl_data *td)
{
	struct cgroup_subsys_state *pos_css;
@@ -611,6 +612,11 @@ static void blk_throtl_update_limit_valid(struct throtl_data *td)

	td->limit_valid[LIMIT_LOW] = low_valid;
}
#else
static inline void blk_throtl_update_limit_valid(struct throtl_data *td)
{
}
#endif

static void throtl_upgrade_state(struct throtl_data *td);
static void throtl_pd_offline(struct blkg_policy_data *pd)