Re: [PATCH] Make is_mem_section_removable more conformable withofflining code

From: KAMEZAWA Hiroyuki
Date: Thu Sep 02 2010 - 01:50:26 EST


On Wed, 1 Sep 2010 14:41:38 +0200
Michal Hocko <mhocko@xxxxxxx> wrote:

> On Wed 01-09-10 14:19:51, Michal Hocko wrote:
> > On Tue 31-08-10 22:19:42, Wu Fengguang wrote:
> > > On Mon, Aug 23, 2010 at 05:22:46PM +0800, Michal Hocko wrote:
> > > > On Sun 22-08-10 08:42:32, Wu Fengguang wrote:
> > > > > Hi Michal,
> > > >
> > > > Hi,
> > > >
> > > > >
> > > > > It helps to explain in changelog/code
> > > > >
> > > > > - in what situation a ZONE_MOVABLE will contain !MIGRATE_MOVABLE
> > > > > pages?
> > > >
> > > > page can be MIGRATE_RESERVE IIUC.
> > >
> > > Yup, it may also be set to MIGRATE_ISOLATE by soft_offline_page().
> >
> > Doesn't it make sense to check for !MIGRATE_UNMOVABLE then?
>
> Something like the following patch.
>
>
> From de85f1aa42115678d3340f0448cd798577036496 Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko@xxxxxxx>
> Date: Fri, 20 Aug 2010 15:39:16 +0200
> Subject: [PATCH] Make is_mem_section_removable more conformable with offlining code
>
> Currently is_mem_section_removable checks whether each pageblock from
> the given pfn range is of MIGRATE_MOVABLE type or if it is free. If both
> are false then the range is considered non removable.
>
> On the other hand, offlining code (more specifically
> set_migratetype_isolate) doesn't care whether a page is free and instead
> it just checks the migrate type of the page and whether the page's zone
> is movable.
>
> This can lead into a situation when we can mark a node as not removable
> just because a pageblock is MIGRATE_RESERVE and it is not free.
>
> Let's make a common helper is_page_removable which unifies both tests
> at one place. Also let's check for MIGRATE_UNMOVABLE rather than all
> possible MIGRATEable types.
>
> Signed-off-by: Michal Hocko <mhocko@xxxxxxx>

Hmm..Why MIGRATE_RECLAIMABLE is included ?

If MIGRATE_RCLAIMABLE is included, set_migrate_type() should check the
range of pages. Because it makes the pageblock as MIGRAGE_MOVABLE after
failure of memory hotplug.

Original code checks.

- the range is MIGRAGE_MOVABLE or
- the range includes only free pages and LRU pages.

Then, moving them back to MIGRAGE_MOVABLE after failure was correct.
Doesn't this makes changes MIGRATE_RECALIMABLE to be MIGRATE_MOVABLE and
leads us to more fragmentated situation ?

Thanks,
-Kame


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