cgroup: properly init u64_stats

Lockdep complains that the stats update is trying to register a non-static
key. This is because u64_stats are using a seqlock on 32bit arches, which
needs to be initialized before usage.

Fixes: 041cd640b2 (cgroup: Implement cgroup2 basic CPU usage accounting)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Lucas Stach 2017-11-28 13:59:25 +01:00 коммит произвёл Tejun Heo
Родитель ddf7005f32
Коммит 52cf373c37
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -296,8 +296,12 @@ int cgroup_stat_init(struct cgroup *cgrp)
} }
/* ->updated_children list is self terminated */ /* ->updated_children list is self terminated */
for_each_possible_cpu(cpu) for_each_possible_cpu(cpu) {
cgroup_cpu_stat(cgrp, cpu)->updated_children = cgrp; struct cgroup_cpu_stat *cstat = cgroup_cpu_stat(cgrp, cpu);
cstat->updated_children = cgrp;
u64_stats_init(&cstat->sync);
}
prev_cputime_init(&cgrp->stat.prev_cputime); prev_cputime_init(&cgrp->stat.prev_cputime);