linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Dave Hansen <dave.hansen@linux.intel.com>,
	yang.shi@linux.alibaba.com, rientjes@google.com,
	dan.j.williams@intel.com, david@redhat.com, osalvador@suse.de,
	weixugc@google.com, Michal Hocko <mhocko@suse.com>,
	Yang Shi <shy828301@gmail.com>, Zi Yan <ziy@nvidia.com>
Subject: Re: [PATCH -V10 0/9] Migrate Pages in lieu of discard
Date: Fri, 16 Jul 2021 11:32:09 +0800	[thread overview]
Message-ID: <87k0lrndc6.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <20210715123836.ad76b0a2e29c0bbd3cd67767@linux-foundation.org> (Andrew Morton's message of "Thu, 15 Jul 2021 12:38:36 -0700")

Andrew Morton <akpm@linux-foundation.org> writes:

> On Thu, 15 Jul 2021 13:51:36 +0800 Huang Ying <ying.huang@intel.com> wrote:
>
> The [0/n] description talks a lot about PMEM, but the patches
> themselves are all about NUMA nodes.  I assume that what ties this
> together is that the PMEM tends to be organized as a NUMA node on its
> own, and that by enabling migrate-to-remote-node-during-reclaim, we get
> this PMEM behaviour as a desired side-effect?
>
> IOW, perhaps this [0/n] description could explain the linkage between
> PMEM and NUMA nodes more explicitly.

Hi, Andrew,

I have added some words in the [0/9] description to link PMEM and NUMA
nodes.  The updated description is as below.  Can you take a look at it?

Best Regards,
Huang, Ying

--------------------------8<-----------------------------------

We're starting to see systems with more and more kinds of memory such
as Intel's implementation of persistent memory.

Let's say you have a system with some DRAM and some persistent memory.
Today, once DRAM fills up, reclaim will start and some of the DRAM
contents will be thrown out.  Allocations will, at some point, start
falling over to the slower persistent memory.

That has two nasty properties.  First, the newer allocations can end
up in the slower persistent memory.  Second, reclaimed data in DRAM
are just discarded even if there are gobs of space in persistent
memory that could be used.

This patchset implements a solution to these problems.  At the end of
the reclaim process in shrink_page_list() just before the last page
refcount is dropped, the page is migrated to persistent memory instead
of being dropped.

While I've talked about a DRAM/PMEM pairing, this approach would
function in any environment where memory tiers exist.

This is not perfect.  It "strands" pages in slower memory and never
brings them back to fast DRAM.  Huang Ying has follow-on work which
repurposes autonuma to promote hot pages back to DRAM.

This is also all based on an upstream mechanism that allows
persistent memory to be onlined and used as if it were volatile:

	http://lkml.kernel.org/r/20190124231441.37A4A305@viggo.jf.intel.com

With that, the DRAM and PMEM in each socket will be represented as 2
separate NUMA nodes, with the CPUs sit in the DRAM node.  So the
general inter-NUMA demotion mechanism introduced in the patchset can
migrate the cold DRAM pages to the PMEM node.

We have tested the patchset with the postgresql and pgbench.  On a
2-socket server machine with DRAM and PMEM, the kernel with the
patchset can improve the score of pgbench up to 22.1% compared with
that of the DRAM only + disk case.  This comes from the reduced disk
read throughput (which reduces up to 70.8%).

== Open Issues ==

 * Memory policies and cpusets that, for instance, restrict allocations
   to DRAM can be demoted to PMEM whenever they opt in to this
   new mechanism.  A cgroup-level API to opt-in or opt-out of
   these migrations will likely be required as a follow-on.
 * Could be more aggressive about where anon LRU scanning occurs
   since it no longer necessarily involves I/O.  get_scan_count()
   for instance says: "If we have no swap space, do not bother
   scanning anon pages"

  parent reply	other threads:[~2021-07-16  3:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  5:51 [PATCH -V10 0/9] Migrate Pages in lieu of discard Huang Ying
2021-07-15  5:51 ` [PATCH -V10 1/9] mm/numa: automatically generate node migration order Huang Ying
2021-07-15 17:52   ` Zi Yan
2021-07-15  5:51 ` [PATCH -V10 2/9] mm/migrate: update node demotion order on hotplug events Huang Ying
2021-07-15 18:00   ` Zi Yan
2021-07-15  5:51 ` [PATCH -V10 3/9] mm/migrate: enable returning precise migrate_pages() success count Huang Ying
2021-07-15 18:02   ` Zi Yan
2021-07-15  5:51 ` [PATCH -V10 4/9] mm/migrate: demote pages during reclaim Huang Ying
2021-07-15  5:51 ` [PATCH -V10 5/9] mm/vmscan: add page demotion counter Huang Ying
2021-07-15  5:51 ` [PATCH -V10 6/9] mm/vmscan: add helper for querying ability to age anonymous pages Huang Ying
2021-07-15  5:51 ` [PATCH -V10 7/9] mm/vmscan: Consider anonymous pages without swap Huang Ying
2021-07-15  5:51 ` [PATCH -V10 8/9] mm/vmscan: never demote for memcg reclaim Huang Ying
2021-07-15  5:51 ` [PATCH -V10 9/9] mm/migrate: add sysfs interface to enable reclaim migration Huang Ying
2021-07-15 19:38 ` [PATCH -V10 0/9] Migrate Pages in lieu of discard Andrew Morton
2021-07-15 21:42   ` Dave Hansen
2021-07-16  1:10     ` Matthew Wilcox
2021-07-16  3:32   ` Huang, Ying [this message]
2021-07-16  3:54     ` Andrew Morton

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=87k0lrndc6.fsf@yhuang6-desk2.ccr.corp.intel.com \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=rientjes@google.com \
    --cc=shy828301@gmail.com \
    --cc=weixugc@google.com \
    --cc=yang.shi@linux.alibaba.com \
    --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).