cgroup/cpuset: Fix incorrect top_cpuset flags
Subsystems (2)
Waiman Long
maintainerCommit 8996f93fc388 ("cgroup/cpuset: Statically initialize more members of top_cpuset") uses an incorrect "<" relational operator for the CS_SCHED_LOAD_BALANCE bit when initializing the top_cpuset. This results in load_balancing turned off by default in the top cpuset which is bad for performance.
Fix this by using the BIT() helper macro to set the desired top_cpuset flags and avoid similar mistake from being made in the future.
--- kernel/cgroup/cpuset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/cgroup/cpuset.c +2 -2
@@ -368,8 +368,8 @@ static inline void notify_partition_change(struct cpuset *cs, int old_prs) }static struct cpuset top_cpuset = { - .flags = ((1 <<CS_ONLINE ) | (1 <<CS_CPU_EXCLUSIVE ) | - (1 <<CS_MEM_EXCLUSIVE ) | (1 <CS_SCHED_LOAD_BALANCE )), + .flags =BIT (CS_ONLINE ) |BIT (CS_CPU_EXCLUSIVE ) | +BIT (CS_MEM_EXCLUSIVE ) |BIT (CS_SCHED_LOAD_BALANCE ), .partition_root_state =PRS_ROOT , .relax_domain_level =-1 , .remote_sibling =LIST_HEAD_INIT (top_cpuset.remote_sibling),
Signature · 1 line
2.39.3
Waiman Long
maintainerQuoted 20 lines · Waiman Long
Commit
8996f93fc388("cgroup/cpuset: Statically initialize more members oftop_cpuset") uses an incorrect "<" relational operator for theCS_SCHED_LOAD_BALANCEbit when initializing thetop_cpuset. This results inload_balancingturned off by default in the top cpuset which is bad for performance.Fix this by using the
BIT()helper macro to set the desiredtop_cpusetflags and avoid similar mistake from being made in the future.Fixes 8996f93fc388 ("cgroup/cpuset: Statically initialize more members of top_cpuset")Signed-off-by Waiman Long <[email protected]>--- kernel/cgroup/cpuset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/cgroup/cpuset.c +0
-0
kernel/cgroup/cpuset.c static inline void notify_partition_change(struct cpuset *cs, int old_prs) · line 375
Quoted 10 lines
kernel/cgroup/cpuset.c +2
-2@@ -368,8 +368,8 @@ static inline void notify_partition_change(struct cpuset *cs, int old_prs) }static struct cpuset top_cpuset = { - .flags = ((1 <<CS_ONLINE ) | (1 <<CS_CPU_EXCLUSIVE ) | - (1 <<CS_MEM_EXCLUSIVE ) | (1 <CS_SCHED_LOAD_BALANCE )), + .flags =BIT (CS_ONLINE ) |BIT (CS_CPU_EXCLUSIVE ) | +BIT (CS_MEM_EXCLUSIVE ) |BIT (CS_SCHED_LOAD_BALANCE ), .partition_root_state =PRS_ROOT , .relax_domain_level =-1 , .remote_sibling =LIST_HEAD_INIT (top_cpuset.remote_sibling),
Add cc to xiujianfeng <[email protected]>
Quoted 18 lines · Waiman Long
Quoted 16 lines · Waiman Long
Commit
8996f93fc388("cgroup/cpuset: Statically initialize more members oftop_cpuset") uses an incorrect "<" relational operator for theCS_SCHED_LOAD_BALANCEbit when initializing thetop_cpuset. This results inload_balancingturned off by default in the top cpuset which is bad for performance.Fix this by using the
BIT()helper macro to set the desiredtop_cpusetflags and avoid similar mistake from being made in the future.Fixes 8996f93fc388 ("cgroup/cpuset: Statically initialize moremembers of
top_cpuset")Signed-off-by Waiman Long <[email protected]>---
kernel/cgroup/cpuset.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
kernel/cgroup/cpuset.c +0
-0kernel/cgroup/cpuset.c static inline void notify_partition_change(struct · line 375
Quoted 10 lines
kernel/cgroup/cpuset.c +2
-2@@ -368,8 +368,8 @@ static inline void notify_partition_change(struct cpuset *cs, int old_prs) } static struct cpuset top_cpuset = { - .flags = ((1 << CS_ONLINE) | (1 << CS_CPU_EXCLUSIVE) | - (1 << CS_MEM_EXCLUSIVE) | (1 < CS_SCHED_LOAD_BALANCE)), + .flags = BIT(CS_ONLINE) | BIT(CS_CPU_EXCLUSIVE) | + BIT(CS_MEM_EXCLUSIVE) | BIT(CS_SCHED_LOAD_BALANCE), .partition_root_state = PRS_ROOT, .relax_domain_level = -1, .remote_sibling = LIST_HEAD_INIT(top_cpuset.remote_sibling),Add cc to xiujianfeng <[email protected]>
Thanks, this looks good. :)
Quoted 1 line
Quoted 11 lines · Waiman Long
Commit
8996f93fc388("cgroup/cpuset: Statically initialize more members oftop_cpuset") uses an incorrect "<" relational operator for theCS_SCHED_LOAD_BALANCEbit when initializing thetop_cpuset. This results inload_balancingturned off by default in the top cpuset which is bad for performance.Fix this by using the
BIT()helper macro to set the desiredtop_cpusetflags and avoid similar mistake from being made in the future.Fixes 8996f93fc388 ("cgroup/cpuset: Statically initialize more members of top_cpuset")Signed-off-by Waiman Long <[email protected]>
Applied to cgroup/for-6.10.
Thanks.
Signature · 1 line
tejun
Klara Modin
Tested-byQuoted 20 lines · Waiman Long
Commit
8996f93fc388("cgroup/cpuset: Statically initialize more members oftop_cpuset") uses an incorrect "<" relational operator for theCS_SCHED_LOAD_BALANCEbit when initializing thetop_cpuset. This results inload_balancingturned off by default in the top cpuset which is bad for performance.Fix this by using the
BIT()helper macro to set the desiredtop_cpusetflags and avoid similar mistake from being made in the future.Fixes 8996f93fc388 ("cgroup/cpuset: Statically initialize more members of top_cpuset")Signed-off-by Waiman Long <[email protected]>--- kernel/cgroup/cpuset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/cgroup/cpuset.c +0
-0
kernel/cgroup/cpuset.c static inline void notify_partition_change(struct cpuset *cs, int old_prs) · line 375
Quoted 10 lines
kernel/cgroup/cpuset.c +2
-2@@ -368,8 +368,8 @@ static inline void notify_partition_change(struct cpuset *cs, int old_prs) }static struct cpuset top_cpuset = { - .flags = ((1 <<CS_ONLINE ) | (1 <<CS_CPU_EXCLUSIVE ) | - (1 <<CS_MEM_EXCLUSIVE ) | (1 <CS_SCHED_LOAD_BALANCE )), + .flags =BIT (CS_ONLINE ) |BIT (CS_CPU_EXCLUSIVE ) | +BIT (CS_MEM_EXCLUSIVE ) |BIT (CS_SCHED_LOAD_BALANCE ), .partition_root_state =PRS_ROOT , .relax_domain_level =-1 , .remote_sibling =LIST_HEAD_INIT (top_cpuset.remote_sibling),
I saw this made its way into today's next and can confirm it fixes the issue I reported in [1].
Thanks,