Re: Patch Upstream: cgroup: reserve ID 0 for dummy_root and 1 for unified hierarchy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch below seems to reference a patch that showed up in 3.11-rc1,
so why would it be relevant for the 3.10 or other stable kernels?

thanks,

greg k-h


> commit: fc76df706123602214da494ba98bccea83e2cfff
> From: Tejun Heo <tj@xxxxxxxxxx>
> Date: Tue, 25 Jun 2013 11:53:37 -0700
> Subject: cgroup: reserve ID 0 for dummy_root and 1 for unified hierarchy
> 
> Before 1a57423166 ("cgroup: make hierarchy_id use cyclic idr"),
> hierarchy IDs were allocated from 0.  As the dummy hierarchy was
> always the one first initialized, it got assigned 0 and all other
> hierarchies from 1.  The patch accidentally changed the minimum
> useable ID to 2.
> 
> Let's restore ID 0 for dummy_root and while at it reserve 1 for
> unified hierarchy.
> 
> Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
> Acked-by: Li Zefan <lizefan@xxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> ---
>  kernel/cgroup.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index cef6881..f9c99ab 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -1425,14 +1425,15 @@ static void init_cgroup_root(struct cgroupfs_root *root)
>  	init_cgroup_housekeeping(cgrp);
>  }
>  
> -static int cgroup_init_root_id(struct cgroupfs_root *root)
> +static int cgroup_init_root_id(struct cgroupfs_root *root, int start, int end)
>  {
>  	int id;
>  
>  	lockdep_assert_held(&cgroup_mutex);
>  	lockdep_assert_held(&cgroup_root_mutex);
>  
> -	id = idr_alloc_cyclic(&cgroup_hierarchy_idr, root, 2, 0, GFP_KERNEL);
> +	id = idr_alloc_cyclic(&cgroup_hierarchy_idr, root, start, end,
> +			      GFP_KERNEL);
>  	if (id < 0)
>  		return id;
>  
> @@ -1635,7 +1636,8 @@ static struct dentry *cgroup_mount(struct file_system_type *fs_type,
>  		if (ret)
>  			goto unlock_drop;
>  
> -		ret = cgroup_init_root_id(root);
> +		/* ID 0 is reserved for dummy root, 1 for unified hierarchy */
> +		ret = cgroup_init_root_id(root, 2, 0);
>  		if (ret)
>  			goto unlock_drop;
>  
> @@ -4898,7 +4900,7 @@ int __init cgroup_init(void)
>  	key = css_set_hash(init_css_set.subsys);
>  	hash_add(css_set_table, &init_css_set.hlist, key);
>  
> -	BUG_ON(cgroup_init_root_id(&cgroup_dummy_root));
> +	BUG_ON(cgroup_init_root_id(&cgroup_dummy_root, 0, 1));
>  
>  	mutex_unlock(&cgroup_root_mutex);
>  	mutex_unlock(&cgroup_mutex);
> -- 
> 1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]