Re: [PATCH 3/6] cpuset: convert cpuset_attach() to use cpumask_var_t

From: Li Zefan
Date: Mon Jan 05 2009 - 04:22:25 EST


>>> OK, that works.
>>>
>>> Do we need to dynamically allocate cpus_attach? Can we just do
>>>
>>> static cpumask_t cpus_attach;
>>>
>>> ?
>>>
>> Yes, it's used by cpuset_attach() only, and cpuset_attach() is called with
>> cgroup_lock() held, so it won't happen that 2 threads access cpus_attach
>> concurrently.
>
> You misunderstand my question. I think.
>
> Can we allocate cpus_attach at compile time? Completely, not
> partially. By doing
>
> static cpumask_t cpus_attach;
>
> instead of
>
> static cpumask_var_t cpus_attach;
> ...
> alloc_cpumask_var(&cpus_attach, GFP_KERNEL);
>
> ?

Ah, I misunderstood. Yes a static cpumask_t works, but what Mike Travis and
Rusty is doing is to remove cpumask_t completely, and replace cpumask_t
with cpumask_var_t wherever possible.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/