[PATCH 02/11] cpuset: add cs->real_cpus_allowed and cs->real_mems_allowed

Tejun Heo tj at kernel.org
Wed Aug 21 13:22:14 UTC 2013


On Wed, Aug 21, 2013 at 05:59:11PM +0800, Li Zefan wrote:
> We're going to have separate user-configured masks and effective ones.
> 
> At last configured masks can only be changed by writing cpuset.cpus

I suppose you mean "eventually" by "at last"?

> and cpuset.mems, and they won't be restricted by parent cpuset. While
> effective masks reflect cpu/memory hotplug and hierachical restriction.
> 
> This patch adds and initializes the effective masks. The effective
> masks of the top cpuset is the same with configured masks, and a child
> cpuset inherites its parent's effective masks.
> 
> This won't introduce behavior change.
> 
> Signed-off-by: Li Zefan <lizefan at huawei.com>
> ---
>  kernel/cpuset.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 46 insertions(+), 11 deletions(-)
> 
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 70ab3fd..404fea5 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -81,8 +81,14 @@ struct cpuset {
>  	struct cgroup_subsys_state css;
>  
>  	unsigned long flags;		/* "unsigned long" so bitops work */
> -	cpumask_var_t cpus_allowed;	/* CPUs allowed to tasks in cpuset */
> -	nodemask_t mems_allowed;	/* Memory Nodes allowed to tasks */
> +
> +	/* user-configured CPUs and Memory Nodes allow to tasks */
> +	cpumask_var_t cpus_allowed;
> +	nodemask_t mems_allowed;
> +
> +	/* effective CPUs and Memory Nodes allow to tasks */
> +	cpumask_var_t real_cpus_allowed;
> +	nodemask_t real_mems_allowed;

Can we stick to the term "effective"?  If it's too long, we can drop
the "allowed" postfix, which is pretty superflous.  effective_cpus and
effective_mems should work, right?  For local vars, ecpus and emems
should do.

Thanks.

-- 
tejun


More information about the Containers mailing list