* Patch "libnvdimm, pfn: fix memmap reservation sizing" has been added to the 4.5-stable tree
@ 2016-05-07 4:49 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-05-07 4:49 UTC (permalink / raw)
To: dan.j.williams, gregkh, namratha.n.kothapalli; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
libnvdimm, pfn: fix memmap reservation sizing
to the 4.5-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
libnvdimm-pfn-fix-memmap-reservation-sizing.patch
and it can be found in the queue-4.5 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 658922e57b847bb7112aa67f6441b6bbc6554412 Mon Sep 17 00:00:00 2001
From: Dan Williams <dan.j.williams@intel.com>
Date: Sat, 30 Apr 2016 13:07:06 -0700
Subject: libnvdimm, pfn: fix memmap reservation sizing
From: Dan Williams <dan.j.williams@intel.com>
commit 658922e57b847bb7112aa67f6441b6bbc6554412 upstream.
When configuring a pfn-device instance to allocate the memmap array it
needs to account for the fact that vmemmap_populate_hugepages()
allocates struct page blocks in HPAGE_SIZE chunks. We need to align the
reserved area size to 2MB otherwise arch_add_memory() runs out of memory
while establishing the memmap:
WARNING: CPU: 0 PID: 496 at arch/x86/mm/init_64.c:704 arch_add_memory+0xe7/0xf0
[..]
Call Trace:
[<ffffffff8148bdb3>] dump_stack+0x85/0xc2
[<ffffffff810a749b>] __warn+0xcb/0xf0
[<ffffffff810a75cd>] warn_slowpath_null+0x1d/0x20
[<ffffffff8106a497>] arch_add_memory+0xe7/0xf0
[<ffffffff811d2097>] devm_memremap_pages+0x287/0x450
[<ffffffff811d1ffa>] ? devm_memremap_pages+0x1ea/0x450
[<ffffffffa0000298>] __wrap_devm_memremap_pages+0x58/0x70 [nfit_test_iomap]
[<ffffffffa0047a58>] pmem_attach_disk+0x318/0x420 [nd_pmem]
[<ffffffffa0047bcf>] nd_pmem_probe+0x6f/0x90 [nd_pmem]
[<ffffffffa0009469>] nvdimm_bus_probe+0x69/0x110 [libnvdimm]
[..]
ndbus0: nd_pmem.probe(pfn3.0) = -12
nd_pmem: probe of pfn3.0 failed with error -12
libndctl: ndctl_pfn_enable: pfn3.0: failed to enable
Reported-by: Namratha Kothapalli <namratha.n.kothapalli@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nvdimm/pmem.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -314,9 +314,16 @@ static int nd_pfn_init(struct nd_pfn *nd
* implementation will limit the pfns advertised through
* ->direct_access() to those that are included in the memmap.
*/
- if (nd_pfn->mode == PFN_MODE_PMEM)
- offset = ALIGN(SZ_8K + 64 * npfns, nd_pfn->align);
- else if (nd_pfn->mode == PFN_MODE_RAM)
+ if (nd_pfn->mode == PFN_MODE_PMEM) {
+ unsigned long memmap_size;
+
+ /*
+ * vmemmap_populate_hugepages() allocates the memmap array in
+ * HPAGE_SIZE chunks.
+ */
+ memmap_size = ALIGN(64 * npfns, PMD_SIZE);
+ offset = ALIGN(SZ_8K + memmap_size, nd_pfn->align);
+ } else if (nd_pfn->mode == PFN_MODE_RAM)
offset = ALIGN(SZ_8K, nd_pfn->align);
else
goto err;
Patches currently in stable-queue which might be from dan.j.williams@intel.com are
queue-4.5/libnvdimm-pfn-fix-memmap-reservation-sizing.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-07 4:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-07 4:49 Patch "libnvdimm, pfn: fix memmap reservation sizing" has been added to the 4.5-stable tree gregkh
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.