Re: [PATCH v9 3/8] cpuset: Rebuild root domain deadline accounting information

From: Michal Koutný
Date: Mon Nov 04 2019 - 13:57:50 EST


Hello.

I came across a cgroup_enable_task_cg_lists() call from the cpuset
controller...

On Fri, Jul 19, 2019 at 03:59:55PM +0200, Juri Lelli <juri.lelli@xxxxxxxxxx> wrote:
> --- a/kernel/cgroup/cpuset.c
> +++ b/kernel/cgroup/cpuset.c
> [...]
> +static void rebuild_root_domains(void)
> +{
> + struct cpuset *cs = NULL;
> + struct cgroup_subsys_state *pos_css;
> +
> + lockdep_assert_held(&cpuset_mutex);
> + lockdep_assert_cpus_held();
> + lockdep_assert_held(&sched_domains_mutex);
> +
> + cgroup_enable_task_cg_lists();
...and I wonder why is it necessary to call at this place?

(IIUC, before cpuset hierarchy is anywhere mounted it's mere top_cpuset,
i.e. processing the top_cpuset alone is enough. And if anyone wants to
create any non-root cpusets, they have to mount the hierachy first, i.e.
no need to call cgroup_enable_task_cg_lists() manually. Also if I'm not
overlooking anything, the race between hotplug and mount (more precisely
new cpuset creation) should be synchronized by cpuset_mutex.)

Thanks,
Michal

Attachment: signature.asc
Description: Digital signature