[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210217174232.GA19239@blackbody.suse.cz>
Date: Wed, 17 Feb 2021 18:42:32 +0100
From: Michal Koutný <mkoutny@...e.com>
To: Johannes Weiner <hannes@...xchg.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Tejun Heo <tj@...nel.org>, Michal Hocko <mhocko@...e.com>,
Roman Gushchin <guro@...com>,
Shakeel Butt <shakeelb@...gle.com>, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-team@...com
Subject: Re: [PATCH v3 4/8] cgroup: rstat: support cgroup1
Hello.
On Tue, Feb 09, 2021 at 11:33:00AM -0500, Johannes Weiner <hannes@...xchg.org> wrote:
> @@ -1971,10 +1978,14 @@ int cgroup_setup_root(struct cgroup_root *root, u16 ss_mask)
> if (ret)
> goto destroy_root;
>
> - ret = rebind_subsystems(root, ss_mask);
> + ret = cgroup_rstat_init(root_cgrp);
Would it make sense to do cgroup_rstat_init() only if there's a subsys
in ss_mask that makes use of rstat?
(On legacy systems there could be individual hierarchy for each
controller so the rstat space can be saved.)
> @@ -5159,11 +5170,9 @@ static struct cgroup *cgroup_create(struct cgroup *parent, const char *name,
> if (ret)
> goto out_free_cgrp;
>
> - if (cgroup_on_dfl(parent)) {
> - ret = cgroup_rstat_init(cgrp);
> - if (ret)
> - goto out_cancel_ref;
> - }
> + ret = cgroup_rstat_init(cgrp);
And here do cgroup_rstat_init() only when parent has it.
> @@ -285,8 +285,6 @@ void __init cgroup_rstat_boot(void)
>
> for_each_possible_cpu(cpu)
> raw_spin_lock_init(per_cpu_ptr(&cgroup_rstat_cpu_lock, cpu));
> -
> - BUG_ON(cgroup_rstat_init(&cgrp_dfl_root.cgrp));
> }
Regardless of the suggestion above, this removal obsoletes the comment
cgroup_rstat_init:
int cpu;
- /* the root cgrp has rstat_cpu preallocated */
if (!cgrp->rstat_cpu) {
cgrp->rstat_cpu = alloc_percpu(struct cgroup_rstat_cpu);
Regards,
Michal
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists