linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@surriel.com>
To: Vlastimil Babka <vbabka@suse.cz>, linux-kernel@vger.kernel.org
Cc: kernel-team@fb.com, akpm@linux-foundation.org,
	linux-mm@kvack.org, mhocko@kernel.org,
	mgorman@techsingularity.net, rientjes@google.com,
	aarcange@redhat.com
Subject: Re: [PATCH 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations
Date: Sat, 29 Feb 2020 21:24:09 -0500	[thread overview]
Message-ID: <af33fa8d3908684df7bac352e037c87a20fb5d3f.camel@surriel.com> (raw)
In-Reply-To: <1094fc21-9104-1410-bc03-f1934dbfcd66@suse.cz>

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

On Fri, 2020-02-28 at 16:17 +0100, Vlastimil Babka wrote:
> On 2/26/20 6:53 PM, Rik van Riel wrote:
> > 
> > It appears that the order in which things are done does
> > not really provide a good moment:
> > 1) decide to attempt allocating a range of memory
> > 2) scan each page block for unmovable pages
> > 3) if no unmovable pages are found, mark the page block
> >    MIGRATE_ISOLATE
> > 
> > I wonder if we should do things the opposite way, first
> > marking the page block MIGRATE_ISOLATE (to prevent new
> > allocations), then scanning it, and calling lru_add_drain_all
> > if we encounter a page that looks like it could benefit from
> > that.
> > 
> > If we still see unmovable pages after that, it is cheap
> > enough to set the page block back to its previous state.
> 
> Yeah seems like the whole has_unmovable_pages() thing isn't much
> useful
> here. It might prevent some unnecessary action like isolating
> something,
> then finding non-movable page and rolling back the isolation. But
> maybe
> it's not worth the savings, and also has_unmovable_pages() being
> false
> doesn't guarantee succeed in the actual isolate+migrate attempt.  And
> if
> it can cause a false negative due to lru pages not drained, then it's
> actually worse than if it wasn't called at all.

We'll experiment with that, and see how often it is an
issue in practice.

If this aspect of the code needs improving, I suspect
Roman and I will find it soon enough.

-- 
All Rights Reversed.

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

      reply	other threads:[~2020-03-01  2:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21 21:53 [PATCH 0/2] fix THP migration for CMA allocations Rik van Riel
2020-02-21 21:53 ` [PATCH 1/2] mm,compaction,cma: add alloc_contig flag to compact_control Rik van Riel
2020-02-24 15:04   ` Vlastimil Babka
2020-02-21 21:53 ` [PATCH 2/2] mm,thp,compaction,cma: allow THP migration for CMA allocations Rik van Riel
2020-02-21 22:31   ` Zi Yan
2020-02-21 22:35     ` Rik van Riel
2020-02-24 15:29   ` Vlastimil Babka
2020-02-25 18:44     ` Rik van Riel
2020-02-26  9:48       ` Vlastimil Babka
2020-02-26 17:53         ` Rik van Riel
2020-02-28 15:17           ` Vlastimil Babka
2020-03-01  2:24             ` Rik van Riel [this message]

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=af33fa8d3908684df7bac352e037c87a20fb5d3f.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=rientjes@google.com \
    --cc=vbabka@suse.cz \
    /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).