Re: [PATCH] mm: compare MIGRATE_ISOLATE selectively

From: Minchan Kim
Date: Thu Dec 20 2012 - 20:09:08 EST


On Thu, Dec 20, 2012 at 04:49:44PM +0100, Michal Nazarewicz wrote:
> On Thu, Dec 20 2012, Minchan Kim wrote:
> > diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
> > index a92061e..4ada4ef 100644
> > --- a/include/linux/page-isolation.h
> > +++ b/include/linux/page-isolation.h
> > @@ -1,6 +1,25 @@
> > #ifndef __LINUX_PAGEISOLATION_H
> > #define __LINUX_PAGEISOLATION_H
> >
> > +#ifdef CONFIG_MEMORY_ISOLATION
> > +static inline bool page_isolated_pageblock(struct page *page)
> > +{
> > + return get_pageblock_migratetype(page) == MIGRATE_ISOLATE;
> > +}
> > +static inline bool mt_isolated_pageblock(int migratetype)
> > +{
> > + return migratetype == MIGRATE_ISOLATE;
> > +}
>
> Perhaps âis_migrate_isolateâ to match already existing âis_migrate_cmaâ?

Good poking. In fact, while I made this patch, I was very tempted by renaming
is_migrate_cma to cma_pageblock.

is_migrate_cma(mt)

I don't know who start to use "mt" instead of "migratetype" but anyway, it's
not a good idea.

is_migrate_cma(migratetype)

It's very clear for me because migratetype is per pageblock, we can know the
function works per pageblock unit.

> Especially as the âmt_isolated_pageblockâ sound confusing to me, it
> implies that it works on pageblocks which it does not.

-ENOPARSE.

migratetype works on pageblock.
I admit mt is really dirty but I used page_alloc.c already has lots of mt, SIGH.

How about this?

1. Let's change all "mt" with "migratetype" again.
2. use is_migrate_isolate and is_migrate_cma for "migratetype".
3. use is_migrate_isolate_page instead of page_isolated_pageblock for "page".

Okay?

>
> > +#else
> > +static inline bool page_isolated_pageblock(struct page *page)
> > +{
> > + return false;
> > +}
> > +static inline bool mt_isolated_pageblock(int migratetype)
> > +{
> > + return false;
> > +}
> > +#endif
> >
> > bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
> > bool skip_hwpoisoned_pages);
> --
> Best regards, _ _
> .o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
> ..o | Computer Science, MichaÅ âmina86â Nazarewicz (o o)
> ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--





--
Kind regards,
Minchan Kim
--
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/