linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Mike Kravetz <mike.kravetz@oracle.com>, linux-kernel@vger.kernel.org
Cc: kernel-team@fb.com, akpm@linux-foundation.org,
	linux-mm@kvack.org,  mhocko@kernel.org, vbabka@suse.cz,
	mgorman@techsingularity.net,  rientjes@google.com,
	aarcange@redhat.com, ziy@nvidia.com
Subject: Re: [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations
Date: Thu, 27 Feb 2020 20:21:38 -0500	[thread overview]
Message-ID: <7800e98e3688c124ac3672284b87d67321e1c29e.camel@surriel.com> (raw)
In-Reply-To: <df83c62f-209f-b1fd-3a5c-c81c82cb2606@oracle.com>

[-- Attachment #1: Type: text/plain, Size: 1461 bytes --]

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.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-02-28  1:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27 21:32 [PATCH v2 0/2] fix THP migration for CMA allocations Rik van Riel
2020-02-27 21:32 ` [PATCH 1/2] mm,compaction,cma: add alloc_contig flag to compact_control Rik van Riel
2020-02-27 21:32 ` [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations Rik van Riel
2020-02-27 23:41   ` Mike Kravetz
2020-02-28  1:21     ` Rik van Riel [this message]
2020-02-28  4:30       ` Mike Kravetz
2020-02-28  8:25       ` Vlastimil Babka
2020-02-28 14:32         ` Rik van Riel
2020-02-28 14:39           ` Vlastimil Babka
2020-02-28 15:47             ` [PATCH] fix mmthpcompactioncma-allow-thp-migration-for-cma-allocations.patch Rik van Riel
2020-03-02  9:32   ` [PATCH v2 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations Vlastimil Babka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7800e98e3688c124ac3672284b87d67321e1c29e.camel@surriel.com \
    --to=riel@surriel.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=mike.kravetz@oracle.com \
    --cc=rientjes@google.com \
    --cc=vbabka@suse.cz \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).