Re: [patch 13/13] mm: memcontrol: rewrite uncharge API

From: Michal Hocko
Date: Tue Jul 15 2014 - 14:22:00 EST


On Tue 15-07-14 13:34:39, Johannes Weiner wrote:
> On Tue, Jul 15, 2014 at 06:07:35PM +0200, Michal Hocko wrote:
> > On Tue 15-07-14 11:55:37, Naoya Horiguchi wrote:
> > > On Wed, Jun 18, 2014 at 04:40:45PM -0400, Johannes Weiner wrote:
> > > ...
> > > > diff --git a/mm/swap.c b/mm/swap.c
> > > > index a98f48626359..3074210f245d 100644
> > > > --- a/mm/swap.c
> > > > +++ b/mm/swap.c
> > > > @@ -62,6 +62,7 @@ static void __page_cache_release(struct page *page)
> > > > del_page_from_lru_list(page, lruvec, page_off_lru(page));
> > > > spin_unlock_irqrestore(&zone->lru_lock, flags);
> > > > }
> > > > + mem_cgroup_uncharge(page);
> > > > }
> > > >
> > > > static void __put_single_page(struct page *page)
> > >
> > > This seems to cause a list breakage in hstate->hugepage_activelist
> > > when freeing a hugetlbfs page.
> >
> > This looks like a fall out from
> > http://marc.info/?l=linux-mm&m=140475936311294&w=2
> >
> > I didn't get to review this one but the easiest fix seems to be check
> > HugePage and do not call uncharge.
>
> Yes, that makes sense. I'm also moving the uncharge call into
> __put_single_page() and __put_compound_page() so that PageHuge(), a
> function call, only needs to be checked for compound pages.

Hmm, there doesn't seem to be any point in calling __page_cache_release
for HugePage as well. So it should be sufficient that
__put_compound_page doesn't call __page_cache_release for PageHuge and
uncharge can stay there. Maybe this would be slightly better...
--
Michal Hocko
SUSE Labs
--
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/