[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <47198271414db19cecbfa1a6ea685577dad3a72c.camel@surriel.com>
Date: Fri, 28 Feb 2020 09:32:04 -0500
From: Rik van Riel <riel@...riel.com>
To: Vlastimil Babka <vbabka@...e.cz>,
Mike Kravetz <mike.kravetz@...cle.com>,
linux-kernel@...r.kernel.org
Cc: kernel-team@...com, akpm@...ux-foundation.org, linux-mm@...ck.org,
mhocko@...nel.org, mgorman@...hsingularity.net,
rientjes@...gle.com, aarcange@...hat.com, ziy@...dia.com
Subject: Re: [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for
CMA allocations
On Fri, 2020-02-28 at 09:25 +0100, Vlastimil Babka wrote:
> On 2/28/20 2:21 AM, Rik van Riel wrote:
> > On Thu, 2020-02-27 at 15:41 -0800, Mike Kravetz wrote:
> > > On 2/27/20 1:32 PM, Rik van Riel wrote:
> > > > +++ b/mm/page_alloc.c
> > > > @@ -8253,14 +8253,19 @@ struct page *has_unmovable_pages(struct
> > > > zone *zone, struct page *page,
> > > >
> > > > /*
> > > > * Hugepages are not in LRU lists, but they're
> > > > movable.
> > > > + * THPs are on the LRU, but need to be counted
> > > > as
> > > > #small pages.
> > > > * We need not scan over tail pages because we
> > > > don't
> > > > * handle each tail page individually in
> > > > migration.
> > > > */
> > > > - if (PageHuge(page)) {
> > > > + if (PageHuge(page) || PageTransCompound(page))
> > > > {
> > > > struct page *head =
> > > > compound_head(page);
> > > > unsigned int skip_pages;
> > > >
> > > > - if
> > > > (!hugepage_migration_supported(page_hstate(head)))
> > > > + if (PageHuge(page) &&
> > > > + !hugepage_migration_supported(page_
> > > > hstate(h
> > > > ead)))
> > > > + return page;
> > > > +
> > > > + if (!PageLRU(head) &&
> > > > !__PageMovable(head))
> > >
> > > Pretty sure this is going to be true for hugetlb pages. So, this
> > > will change
> > > behavior and make all hugetlb pages look unmovable. Perhaps,
> > > only
> > > check this
> > > condition for THP pages?
>
> Oh right you are.
>
> > Does that need to be the following, then?
> >
> > if (PageTransHuge(head) && !PageHuge(page) && !PageLRU(head)
> > &&
> > !__PageMovable(head))
> > return page;
>
> I would instead make it an "else if" to the "if (PageHuge(page)...)"
> above.
That was my first thought too, but that could break on
pages that are PageHuge when hugepage_migration_supported
returns true.
--
All Rights Reversed.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists