[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9295b73a-5a3c-b1f6-d892-0da1d356ab9f@redhat.com>
Date: Tue, 20 Dec 2022 11:59:00 -0500
From: Waiman Long <longman@...hat.com>
To: Daniel Vacek <neelx@...hat.com>,
Zefan Li <lizefan.x@...edance.com>, Tejun Heo <tj@...nel.org>,
Johannes Weiner <hannes@...xchg.org>
Cc: cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cgroup/cpuset: no need to explicitly init a global static
variable
On 12/20/22 10:14, Daniel Vacek wrote:
> cpuset_rwsem is a static variable. 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@...hat.com>
> ---
> kernel/cgroup/cpuset.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
> index a29c0b13706bb..87fe410361b3d 100644
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> @@ -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));
It will be clearer if you mention that DEFINE_STATIC_PERCPU_RWSEM() is
used to set up cpuset_rwsem at build time. Other than that, the patch
looks good to me.
Cheers,
Longman
Powered by blists - more mailing lists