lkml.org 
[lkml]   [2013]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/8] memcg: fail to create cgroup if the cgroup id is too big
On Mon 08-04-13 16:22:34, Li Zefan wrote:
> memcg requires the cgroup id to be smaller than 65536.
>
> Signed-off-by: Li Zefan <lizefan@huawei.com>

But this should be moved up the patch stack as mentioned in the previous
email.

Acked-by: Michal Hocko <mhocko@suse.cz>
Minor nit bellow.

> ---
> mm/memcontrol.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index c4e0173..947dff1 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -492,6 +492,12 @@ static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
> return (memcg == root_mem_cgroup);
> }
>
> +/*
> + * We restrict the id in the range of [0, 65535], so it can fit into
> + * an unsigned short.
> + */
> +#define MEM_CGROUP_ID_MAX (65535)

USHRT_MAX ?

> +
> static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg)
> {
> return memcg->css.cgroup->id;
--
Michal Hocko
SUSE Labs


\
 
 \ /
  Last update: 2013-04-08 18:01    [W:0.151 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site