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

From: KAMEZAWA Hiroyuki
Date: Wed Apr 15 2009 - 20:49:22 EST


On Wed, 15 Apr 2009 12:13:17 +0200
Andrea Righi <righi.andrea@xxxxxxxxx> wrote:

> The warning is still there actually. I've just written a fix and seen
> this discussion, maybe I can offload a little bit Kame. ;)
>
> -Andrea

Thank you.
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

> ---
> memcg: remove warning when CONFIG_DEBUG_VM is not set
>
> Fix the following warning removing mem_cgroup_is_obsolete():
>
> mm/memcontrol.c:318: warning: ‘mem_cgroup_is_obsolete’ defined but not used
>
> Moreover, split the VM_BUG_ON() checks in two parts to be aware of which
> one triggered the bug.
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Andrea Righi <righi.andrea@xxxxxxxxx>
> ---
> mm/memcontrol.c | 11 ++---------
> 1 files changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index e44fb0f..8cd6358 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
> return mem;
> }
>
> -static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
> -{
> - if (!mem)
> - return true;
> - return css_is_removed(&mem->css);
> -}
> -
> -
> /*
> * Call callback function against all cgroup under hierarchy tree.
> */
> @@ -932,7 +924,8 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
> if (unlikely(!mem))
> return 0;
>
> - VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem));
> + VM_BUG_ON(!mem);
> + VM_BUG_ON(css_is_removed(&mem->css));
>
> while (1) {
> int ret;
> --
> 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/

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