提交 87ac3a50 编写于 作者: Y Yu Kuai 提交者: Yang Yingliang

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

hulk inclusion
category: bugfix
bugzilla: 46357
CVE: NA

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

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: NYu Kuai <yukuai3@huawei.com>
Reviewed-by: NTao Hou <houtao1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 37fe5913
...@@ -568,6 +568,7 @@ static void throtl_pd_online(struct blkg_policy_data *pd) ...@@ -568,6 +568,7 @@ static void throtl_pd_online(struct blkg_policy_data *pd)
tg_update_has_rules(tg); tg_update_has_rules(tg);
} }
#ifdef CONFIG_BLK_DEV_THROTTLING_LOW
static void blk_throtl_update_limit_valid(struct throtl_data *td) static void blk_throtl_update_limit_valid(struct throtl_data *td)
{ {
struct cgroup_subsys_state *pos_css; struct cgroup_subsys_state *pos_css;
...@@ -588,6 +589,11 @@ static void blk_throtl_update_limit_valid(struct throtl_data *td) ...@@ -588,6 +589,11 @@ static void blk_throtl_update_limit_valid(struct throtl_data *td)
td->limit_valid[LIMIT_LOW] = low_valid; 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_upgrade_state(struct throtl_data *td);
static void throtl_pd_offline(struct blkg_policy_data *pd) static void throtl_pd_offline(struct blkg_policy_data *pd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册