From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>
Cc: "tiwai@suse.de" <tiwai@suse.de>, "bp@suse.de" <bp@suse.de>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"Williams, Dan J" <dan.j.williams@intel.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
"jglisse@redhat.com" <jglisse@redhat.com>,
"zwisler@kernel.org" <zwisler@kernel.org>,
"mhocko@suse.com" <mhocko@suse.com>,
"Jiang, Dave" <dave.jiang@intel.com>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"thomas.lendacky@amd.com" <thomas.lendacky@amd.com>,
"Busch, Keith" <keith.busch@intel.com>,
"Huang, Ying" <ying.huang@intel.com>,
"Wu, Fengguang" <fengguang.wu@intel.com>,
"baiyaowei@cmss.chinamobile.com" <baiyaowei@cmss.chinamobile.com>
Subject: Re: [PATCH 5/5] dax: "Hotplug" persistent memory for use like normal RAM
Date: Mon, 25 Feb 2019 22:56:27 +0000 [thread overview]
Message-ID: <68f1da72779fcbb8b0cab8ab5927b918c3ea9711.camel@intel.com> (raw)
In-Reply-To: <20190225185740.8660866F@viggo.jf.intel.com>
On Mon, 2019-02-25 at 10:57 -0800, Dave Hansen wrote:
> From: Dave Hansen <dave.hansen@linux.intel.com>
>
> This is intended for use with NVDIMMs that are physically persistent
> (physically like flash) so that they can be used as a cost-effective
> RAM replacement. Intel Optane DC persistent memory is one
> implementation of this kind of NVDIMM.
>
> Currently, a persistent memory region is "owned" by a device driver,
> either the "Direct DAX" or "Filesystem DAX" drivers. These drivers
> allow applications to explicitly use persistent memory, generally
> by being modified to use special, new libraries. (DIMM-based
> persistent memory hardware/software is described in great detail
> here: Documentation/nvdimm/nvdimm.txt).
>
> However, this limits persistent memory use to applications which
> *have* been modified. To make it more broadly usable, this driver
> "hotplugs" memory into the kernel, to be managed and used just like
> normal RAM would be.
>
> To make this work, management software must remove the device from
> being controlled by the "Device DAX" infrastructure:
>
> echo dax0.0 > /sys/bus/dax/drivers/device_dax/unbind
>
> and then tell the new driver that it can bind to the device:
>
> echo dax0.0 > /sys/bus/dax/drivers/kmem/new_id
>
> After this, there will be a number of new memory sections visible
> in sysfs that can be onlined, or that may get onlined by existing
> udev-initiated memory hotplug rules.
>
> This rebinding procedure is currently a one-way trip. Once memory
> is bound to "kmem", it's there permanently and can not be
> unbound and assigned back to device_dax.
>
> The kmem driver will never bind to a dax device unless the device
> is *explicitly* bound to the driver. There are two reasons for
> this: One, since it is a one-way trip, it can not be undone if
> bound incorrectly. Two, the kmem driver destroys data on the
> device. Think of if you had good data on a pmem device. It
> would be catastrophic if you compile-in "kmem", but leave out
> the "device_dax" driver. kmem would take over the device and
> write volatile data all over your good data.
>
> This inherits any existing NUMA information for the newly-added
> memory from the persistent memory device that came from the
> firmware. On Intel platforms, the firmware has guarantees that
> require each socket's persistent memory to be in a separate
> memory-only NUMA node. That means that this patch is not expected
> to create NUMA nodes, but will simply hotplug memory into existing
> nodes.
>
> Because NUMA nodes are created, the existing NUMA APIs and tools
> are sufficient to create policies for applications or memory areas
> to have affinity for or an aversion to using this memory.
>
> There is currently some metadata at the beginning of pmem regions.
> The section-size memory hotplug restrictions, plus this small
> reserved area can cause the "loss" of a section or two of capacity.
> This should be fixable in follow-on patches. But, as a first step,
> losing 256MB of memory (worst case) out of hundreds of gigabytes
> is a good tradeoff vs. the required code to fix this up precisely.
> This calculation is also the reason we export
> memory_block_size_bytes().
>
> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
> Reviewed-by: Keith Busch <keith.busch@intel.com>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Ross Zwisler <zwisler@kernel.org>
> Cc: Vishal Verma <vishal.l.verma@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: linux-nvdimm@lists.01.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> Cc: Huang Ying <ying.huang@intel.com>
> Cc: Fengguang Wu <fengguang.wu@intel.com>
> Cc: Borislav Petkov <bp@suse.de>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Yaowei Bai <baiyaowei@cmss.chinamobile.com>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: Jerome Glisse <jglisse@redhat.com>
> ---
>
> b/drivers/base/memory.c | 1
> b/drivers/dax/Kconfig | 16 +++++++
> b/drivers/dax/Makefile | 1
> b/drivers/dax/kmem.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 126 insertions(+)
Looks good,
Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
next prev parent reply other threads:[~2019-02-25 22:56 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 18:57 [PATCH 0/5] [v5] Allow persistent memory to be used like normal RAM Dave Hansen
2019-02-25 18:57 ` [PATCH 1/5] mm/resource: return real error codes from walk failures Dave Hansen
2019-02-26 7:41 ` Christophe Leroy
2019-02-25 18:57 ` [PATCH 2/5] mm/resource: move HMM pr_debug() deeper into resource code Dave Hansen
2019-02-25 18:57 ` [PATCH 3/5] mm/memory-hotplug: allow memory resources to be children Dave Hansen
2019-02-25 18:57 ` [PATCH 4/5] mm/resource: let walk_system_ram_range() search child resources Dave Hansen
2019-02-25 18:57 ` [PATCH 5/5] dax: "Hotplug" persistent memory for use like normal RAM Dave Hansen
2019-02-25 22:56 ` Verma, Vishal L [this message]
2019-02-28 7:53 ` [PATCH 0/5] [v5] Allow persistent memory to be used " Dan Williams
-- strict thread matches above, loose matches on Subject: below --
2019-01-24 23:14 [PATCH 0/5] [v4] " Dave Hansen
2019-01-24 23:14 ` [PATCH 5/5] dax: "Hotplug" persistent memory for use " Dave Hansen
2019-01-24 23:14 ` Dave Hansen
2019-01-25 6:13 ` Jane Chu
2019-01-25 6:27 ` Dan Williams
2019-01-25 6:27 ` Dan Williams
2019-01-25 8:20 ` Du, Fan
2019-01-25 17:18 ` Dan Williams
2019-01-25 18:20 ` Verma, Vishal L
2019-01-25 19:10 ` Jane Chu
2019-01-25 19:15 ` Dan Williams
2019-01-25 19:15 ` Dan Williams
2019-01-25 23:30 ` Jane Chu
2019-01-28 9:25 ` Michal Hocko
2019-01-28 16:34 ` Dan Williams
2019-01-28 16:34 ` Dan Williams
2019-02-09 11:00 ` Brice Goglin
2019-02-11 16:22 ` Dave Hansen
2019-02-12 19:59 ` Brice Goglin
2019-02-13 0:30 ` Dan Williams
2019-02-13 8:12 ` Brice Goglin
2019-02-13 8:24 ` Dan Williams
2019-02-13 8:43 ` Brice Goglin
2019-02-13 13:06 ` Brice Goglin
2019-02-13 16:19 ` Dan Williams
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=68f1da72779fcbb8b0cab8ab5927b918c3ea9711.camel@intel.com \
--to=vishal.l.verma@intel.com \
--cc=akpm@linux-foundation.org \
--cc=baiyaowei@cmss.chinamobile.com \
--cc=bhelgaas@google.com \
--cc=bp@suse.de \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=dave.jiang@intel.com \
--cc=fengguang.wu@intel.com \
--cc=jglisse@redhat.com \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nvdimm@lists.01.org \
--cc=mhocko@suse.com \
--cc=thomas.lendacky@amd.com \
--cc=tiwai@suse.de \
--cc=ying.huang@intel.com \
--cc=zwisler@kernel.org \
/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).