Skip to content

Commit 8996f93

Browse files
Xiu Jianfenghtejun
authored andcommitted
cgroup/cpuset: Statically initialize more members of top_cpuset
Initializing top_cpuset.relax_domain_level and setting CS_SCHED_LOAD_BALANCE to top_cpuset.flags in cpuset_init() could be completed at the time of top_cpuset definition by compiler. Signed-off-by: Xiu Jianfeng <[email protected]> Reviewed-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent 19fc8a8 commit 8996f93

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/cgroup/cpuset.c

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

370370
static struct cpuset top_cpuset = {
371371
.flags = ((1 << CS_ONLINE) | (1 << CS_CPU_EXCLUSIVE) |
372-
(1 << CS_MEM_EXCLUSIVE)),
372+
(1 << CS_MEM_EXCLUSIVE) | (1 < CS_SCHED_LOAD_BALANCE)),
373373
.partition_root_state = PRS_ROOT,
374+
.relax_domain_level = -1,
374375
.remote_sibling = LIST_HEAD_INIT(top_cpuset.remote_sibling),
375376
};
376377

@@ -4309,8 +4310,6 @@ int __init cpuset_init(void)
43094310
nodes_setall(top_cpuset.effective_mems);
43104311

43114312
fmeter_init(&top_cpuset.fmeter);
4312-
set_bit(CS_SCHED_LOAD_BALANCE, &top_cpuset.flags);
4313-
top_cpuset.relax_domain_level = -1;
43144313
INIT_LIST_HEAD(&remote_children);
43154314

43164315
BUG_ON(!alloc_cpumask_var(&cpus_attach, GFP_KERNEL));

0 commit comments

Comments
 (0)