lkml.org 
[lkml]   [2020]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations
From
Date
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?

Does that need to be the following, then?

if (PageTransHuge(head) && !PageHuge(page) && !PageLRU(head) &&
!__PageMovable(head))
return page;

That's an easy one liner I would be happy to send in
if everybody agrees that should fix things :)

--
All Rights Reversed.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-02-28 02:22    [W:0.069 / U:1.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site