Skip to contentSkip to conversation

powerpc/mm/nvdimm: Add an informative message if we fail to allocate altmap block

PATCH Applied Aneesh Kumar K.V 3 participants 3 messages Jul 1, 2019 – Jul 8, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/mm/nvdimm: Add an informative message if we fail to allocate altmap block

Allocation from altmap area can fail based on vmemmap page size used. Add kernel info message to indicate the failure. That allows the user to identify whether they are really using persistent memory reserved space for per-page metadata.

The message looks like:

[  136.587212] altmap block allocation failed, falling back to system memory
---
 arch/powerpc/mm/init_64.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/mm/init_64.c +5 -1
index a4e17a979e45..f3b64f49082b 100644
@@ -194,8 +194,12 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
 		 * fail due to alignment issues when using 16MB hugepages, so
 		 * fall back to system memory if the altmap allocation fail.
 		 */
-		if (altmap)
+		if (altmap) {
 			p = altmap_alloc_block_buf(page_size, altmap);
+			if (!p)
+				pr_debug("altmap block allocation failed, " \
+					"falling back to system memory");
+		}
 		if (!p)
 			p = vmemmap_alloc_block_buf(page_size, node);
 		if (!p)
Signature · 1 line
2.21.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 32 lines · Aneesh Kumar K.V

Allocation from altmap area can fail based on vmemmap page size used. Add kernel info message to indicate the failure. That allows the user to identify whether they are really using persistent memory reserved space for per-page metadata.

The message looks like:

[  136.587212] altmap block allocation failed, falling back to system memory
---
 arch/powerpc/mm/init_64.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
arch/powerpc/mm/init_64.c +5 -2
index a4e17a979e45..f3b64f49082b 100644
@@ -194,8 +194,12 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
                 * fail due to alignment issues when using 16MB hugepages, so
                 * fall back to system memory if the altmap allocation fail.
                 */
-               if (altmap)
+               if (altmap) {
                        p = altmap_alloc_block_buf(page_size, altmap);
+                       if (!p)
+                               pr_debug("altmap block allocation failed, " \
+                                       "falling back to system memory");
+               }
                if (!p)
                        p = vmemmap_alloc_block_buf(page_size, node);
                if (!p)
--
Quoted 2 lines

2.21.0

I'll let mpe decide if he cares about the split line thing :)

#2 lore raw
In reply to Aneesh Kumar K.V
Quoted 9 lines · Aneesh Kumar K.V

Allocation from altmap area can fail based on vmemmap page size used. Add kernel info message to indicate the failure. That allows the user to identify whether they are really using persistent memory reserved space for per-page metadata.

The message looks like:

[  136.587212] altmap block allocation failed, falling back to system memory

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c0b1b23b9c87569d5f90d06e86f26b31b544fa1e

cheers