linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "Huang, Ying" <ying.huang@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, yang.shi@linux.alibaba.com,
	rientjes@google.com, dan.j.williams@intel.com,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: [RFC][PATCH 5/9] mm/migrate: demote pages during reclaim
Date: Thu, 20 Aug 2020 08:21:55 -0700	[thread overview]
Message-ID: <6a378a57-a453-0318-924b-05dfa0a10c1f@intel.com> (raw)
In-Reply-To: <87lfi9wxk9.fsf@yhuang-dev.intel.com>

On 8/20/20 1:06 AM, Huang, Ying wrote:
>> +	/* Migrate pages selected for demotion */
>> +	nr_reclaimed += demote_page_list(&ret_pages, &demote_pages, pgdat, sc);
>> +
>>  	pgactivate = stat->nr_activate[0] + stat->nr_activate[1];
>>  
>>  	mem_cgroup_uncharge_list(&free_pages);
>> _
> Generally, it's good to batch the page migration.  But one side effect
> is that, if the pages are failed to be migrated, they will be placed
> back to the LRU list instead of falling back to be reclaimed really.
> This may cause some issue in some situation.  For example, if there's no
> enough space in the PMEM (slow) node, so the page migration fails, OOM
> may be triggered, because the direct reclaiming on the DRAM (fast) node
> may make no progress, while it can reclaim some pages really before.

Yes, agreed.

There are a couple of ways we could fix this.  Instead of splicing
'demote_pages' back into 'ret_pages', we could try to get them back on
'page_list' and goto the beginning on shrink_page_list().  This will
probably yield the best behavior, but might be a bit ugly.

We could also add a field to 'struct scan_control' and just stop trying
to migrate after it has failed one or more times.  The trick will be
picking a threshold that doesn't mess with either the normal reclaim
rate or the migration rate.

This is on my list to fix up next.

  reply	other threads:[~2020-08-20 15:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 18:41 [RFC][PATCH 0/9] [v3] Migrate Pages in lieu of discard Dave Hansen
2020-08-18 18:41 ` [RFC][PATCH 1/9] mm/numa: node demotion data structure and lookup Dave Hansen
2020-08-18 18:41 ` [RFC][PATCH 2/9] mm/numa: automatically generate node migration order Dave Hansen
2020-08-20 21:57   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 3/9] mm/migrate: update migration order during on hotplug events Dave Hansen
2020-08-20 22:07   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 4/9] mm/migrate: make migrate_pages() return nr_succeeded Dave Hansen
2020-09-17  1:25   ` Huang, Ying
2020-08-18 18:41 ` [RFC][PATCH 5/9] mm/migrate: demote pages during reclaim Dave Hansen
2020-08-20  8:06   ` Huang, Ying
2020-08-20 15:21     ` Dave Hansen [this message]
2020-08-20 16:26       ` Yang Shi
2020-08-21  0:57         ` Huang, Ying
2020-08-21 16:17           ` Yang Shi
2020-08-20 22:42   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 6/9] mm/vmscan: add page demotion counter Dave Hansen
2020-08-20 22:26   ` Yang Shi
2020-08-20 23:58     ` Yang Shi
2020-08-20 22:56   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 7/9] mm/vmscan: Consider anonymous pages without swap Dave Hansen
2020-08-18 18:41 ` [RFC][PATCH 8/9] mm/vmscan: never demote for memcg reclaim Dave Hansen
2020-08-20 22:50   ` Yang Shi
2020-08-18 18:41 ` [RFC][PATCH 9/9] mm/migrate: new zone_reclaim_mode to enable reclaim migration Dave Hansen
2020-08-20  0:47 ` [RFC][PATCH 0/9] [v3] Migrate Pages in lieu of discard Yang Shi
2020-08-24 22:36 ` Keith Busch
2020-10-07 16:17 [RFC][PATCH 0/9] [v4][RESEND] " Dave Hansen
2020-10-07 16:17 ` [RFC][PATCH 5/9] mm/migrate: demote pages during reclaim Dave Hansen
2020-10-27 15:29   ` Oscar Salvador
2020-10-27 16:53     ` Yang Shi

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=6a378a57-a453-0318-924b-05dfa0a10c1f@intel.com \
    --to=dave.hansen@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=yang.shi@linux.alibaba.com \
    --cc=ying.huang@intel.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).