[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20111124103411.GH26036@tiehlicka.suse.cz>
Date: Thu, 24 Nov 2011 11:34:12 +0100
From: Michal Hocko <mhocko@...e.cz>
To: Johannes Weiner <hannes@...xchg.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Balbir Singh <bsingharora@...il.com>, cgroups@...r.kernel.org,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [patch 6/8] mm: memcg: remove unneeded checks from
uncharge_page()
On Thu 24-11-11 10:06:39, Johannes Weiner wrote:
> On Thu, Nov 24, 2011 at 09:06:19AM +0900, KAMEZAWA Hiroyuki wrote:
> > On Wed, 23 Nov 2011 16:42:29 +0100
> > Johannes Weiner <hannes@...xchg.org> wrote:
> >
> > > From: Johannes Weiner <jweiner@...hat.com>
> > >
> > > mem_cgroup_uncharge_page() is only called on either freshly allocated
> > > pages without page->mapping or on rmapped PageAnon() pages. There is
> > > no need to check for a page->mapping that is not an anon_vma.
> > >
> > > Signed-off-by: Johannes Weiner <jweiner@...hat.com>
> >
> > For making our assumption clearer to readers of codes,
> > VM_BUG_ON(page->mapping && !PageAnon(page)) please.
>
> Yep, delta patch below.
>
> > Anyway,
> > Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
>
> Thanks!
>
> ---
> From: Johannes Weiner <jweiner@...hat.com>
> Subject: mm: memcg: remove unneeded checks from uncharge_page() fix
>
> Document page state assumptions and catch if they are violated in
> uncharge_page().
>
> Signed-off-by: Johannes Weiner <jweiner@...hat.com>
Same here
Acked-by: Michal Hocko <mhocko@...e.cz>
> ---
> mm/memcontrol.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 2f1fdc4..872dae1 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -2992,6 +2992,7 @@ void mem_cgroup_uncharge_page(struct page *page)
> /* early check. */
> if (page_mapped(page))
> return;
> + VM_BUG_ON(page->mapping && !PageAnon(page));
> __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_MAPPED);
> }
>
> --
> 1.7.6.4
>
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists