Re: [PATCH 1/2] mm: drop migrate type checks from has_unmovable_pages

From: Michal Hocko
Date: Tue Oct 24 2017 - 03:44:45 EST


On Tue 24-10-17 13:44:23, Joonsoo Kim wrote:
> On Mon, Oct 23, 2017 at 10:10:09AM +0200, Michal Hocko wrote:
[...]
> > My intuitive understanding of set_migratetype_isolate is that it either
> > suceeds and that means that the given pfn range can be isolated for the
> > given type of allocation (be it movable or cma). No new pages will be
> > allocated from this range to allow converging into a free range in a
> > finit amount of time. At least this is how the hotplug code would like
> > to use it and I suppose that the alloc_contig_range would like to
> > guarantee the same to not rely on a fixed amount of migration attempts.
>
> Yes, alloc_contig_range() also want to guarantee the similar thing.
> Major difference between them is 'given pfn range'. memory hotplug
> works by pageblock unit but alloc_contig_range() doesn't.
> alloc_contig_range() works by the page unit. However, there is no easy
> way to isolate individual page so it uses pageblock isolation
> regardless of 'given pfn range'.

I am still confused. So when is it safe to isolate a page from the CMA
pageblock for something that is not a CMA allocation request? Don't we
lose a CMA guanratee that way?

[...]
> > That being said, I would much rather see MIGRATE_CMA case special cased
> > than duplicate the already confusing API but I will not insist of
> > course.
>
> Okay. I atteach the patch. Andrew, could you revert Michal's series
> and apply this patch first? Perhaps, Michal will resend his series on
> top of this one.

I am not convinced about this approach but I will not argue about the
patch though. If this is seen as a right way forward, I will rebase
my patches on top.
--
Michal Hocko
SUSE Labs