Skip to content

Commit

Permalink
cgroup/cpuset: no need to explicitly init a global static variable
Browse files Browse the repository at this point in the history
cpuset_rwsem is a static variable defined with DEFINE_STATIC_PERCPU_RWSEM().
It's initialized at build time and so there's no need for explicit runtime
init leaking one percpu int.

Signed-off-by: Daniel Vacek <neelx@redhat.com>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Acked-by: Mukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Daniel Vacek authored and Tejun Heo committed Jan 4, 2023
1 parent 512dee0 commit 21786e5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions kernel/cgroup/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -3281,8 +3281,6 @@ struct cgroup_subsys cpuset_cgrp_subsys = {

int __init cpuset_init(void)
{
BUG_ON(percpu_init_rwsem(&cpuset_rwsem));

BUG_ON(!alloc_cpumask_var(&top_cpuset.cpus_allowed, GFP_KERNEL));
BUG_ON(!alloc_cpumask_var(&top_cpuset.effective_cpus, GFP_KERNEL));
BUG_ON(!zalloc_cpumask_var(&top_cpuset.subparts_cpus, GFP_KERNEL));
Expand Down

0 comments on commit 21786e5

Please sign in to comment.