Re: [PATCH] memcg remove warning at DEBUG_VM=off

From: Balbir Singh
Date: Wed Apr 08 2009 - 01:28:03 EST


* KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> [2009-04-08 14:20:42]:

> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> This is against 2.6.30-rc1. (maybe no problem against mmotm.)
>
> ==
> Fix warning as
>
> CC mm/memcontrol.o
> mm/memcontrol.c:318: warning: ?$B!Fmem_cgroup_is_obsolete?$B!G defined but not used
>
> This is called only from VM_BUG_ON().
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> ---
> Index: linux-2.6.30-rc1/mm/memcontrol.c
> ===================================================================
> --- linux-2.6.30-rc1.orig/mm/memcontrol.c
> +++ linux-2.6.30-rc1/mm/memcontrol.c
> @@ -314,13 +314,14 @@ static struct mem_cgroup *try_get_mem_cg
> return mem;
> }
>
> +#ifdef CONFIG_DEBUG_VM
> static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
> {
> if (!mem)
> return true;
> return css_is_removed(&mem->css);
> }
> -
> +#endif

Can we change the code to use

VM_BUG_ON(!mem || css_is_removed(&mem->css));

Reviewed-by: Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx>


--
Balbir
--
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/