Re: [PATCH] Add the values related to buddy system for filteringfree pages

From: Atsushi Kumagai
Date: Sun Dec 09 2012 - 21:44:33 EST


Hello Vivek,

On Fri, 7 Dec 2012 10:08:05 -0500
Vivek Goyal <vgoyal@xxxxxxxxxx> wrote:

> On Wed, Nov 21, 2012 at 05:02:47PM +0900, Atsushi Kumagai wrote:
> > This patch adds the values related to buddy system to vmcoreinfo data
> > so that makedumpfile (dump filtering command) can filter out all free
> > pages with the new logic.
> > It's faster than the current logic because it can distinguish free page
> > by analyzing page structure at the same time as filtering for other
> > unnecessary pages (e.g. anonymous page).
> > OTOH, the current logic has to trace free_list to distinguish free
> > pages while analyzing page structure to filter out other unnecessary
> > pages.
> >
> > The new logic uses the fact that buddy page is marked by _mapcount ==
> > PAGE_BUDDY_MAPCOUNT_VALUE. The values below are required to distinguish
> > it.
> >
> > Required values:
> > - OFFSET(page._mapcount)
> > - OFFSET(page.private)
> > - SIZE(pageflags)
> > - NUMBER(PG_slab)
> > - NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE)
> >
>
> As per your explanation, you should just need to export page._mapcount
> offset and PAGE_BUDDY_MAPCOUNT_VALUE value so that you can figure out
> if a page is free or not.
>
> Why do we need rest of the three fields.
>
> - OFFSET(page.private)
> - SIZE(pageflags)
> - NUMBER(PG_slab)

Thanks for your comment.

SIZE(pageflags) is unnecessary as you said, but the other two are
certainly necessary.
I modified the description in v2 to make it clear, please see below:

https://lkml.org/lkml/2012/12/9/138


Thanks
Atsushi Kumagai
--
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/