Skip to content

Commit 04d63da

Browse files
Waiman-Longhtejun
authored andcommitted
cgroup/cpuset: Fix incorrect top_cpuset flags
Commit 8996f93 ("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. Fixes: 8996f93 ("cgroup/cpuset: Statically initialize more members of top_cpuset") Signed-off-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent e878476 commit 04d63da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/cgroup/cpuset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,8 @@ static inline void notify_partition_change(struct cpuset *cs, int old_prs)
368368
}
369369

370370
static struct cpuset top_cpuset = {
371-
.flags = ((1 << CS_ONLINE) | (1 << CS_CPU_EXCLUSIVE) |
372-
(1 << CS_MEM_EXCLUSIVE) | (1 < CS_SCHED_LOAD_BALANCE)),
371+
.flags = BIT(CS_ONLINE) | BIT(CS_CPU_EXCLUSIVE) |
372+
BIT(CS_MEM_EXCLUSIVE) | BIT(CS_SCHED_LOAD_BALANCE),
373373
.partition_root_state = PRS_ROOT,
374374
.relax_domain_level = -1,
375375
.remote_sibling = LIST_HEAD_INIT(top_cpuset.remote_sibling),

0 commit comments

Comments
 (0)