Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1553485

[PATCH 4.8 52/96] s390/kexec: use node 0 when re-adding crash kernel memory

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.8 52/96] s390/kexec: use node 0 when re-adding crash kernel memory
Date 2017-01-07 00:10 +0100
Message-ID <sWLO3-sV-63@gated-at.bofh.it> (permalink)
References <sWKyC-7RC-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.8-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Heiko Carstens <heiko.carstens@de.ibm.com>

commit 9f88eb4df728aebcd2ddd154d99f1d75b428b897 upstream.

When re-adding crash kernel memory within setup_resources() the
function memblock_add() is used. That function will add memory by
default to node "MAX_NUMNODES" instead of node 0, like the memory
detection code does. In case of !NUMA this will trigger this warning
when the kernel generates the vmemmap:

Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead
WARNING: CPU: 0 PID: 0 at mm/memblock.c:1261 memblock_virt_alloc_internal+0x76/0x220
CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.0-rc6 #16
Call Trace:
 [<0000000000d0b2e8>] memblock_virt_alloc_try_nid+0x88/0xc8
 [<000000000083c8ea>] __earlyonly_bootmem_alloc.constprop.1+0x42/0x50
 [<000000000083e7f4>] vmemmap_populate+0x1ac/0x1e0
 [<0000000000840136>] sparse_mem_map_populate+0x46/0x68
 [<0000000000d0c59c>] sparse_init+0x184/0x238
 [<0000000000cf45f6>] paging_init+0xbe/0xf8
 [<0000000000cf1d4a>] setup_arch+0xa02/0xae0
 [<0000000000ced75a>] start_kernel+0x72/0x450
 [<0000000000100020>] _stext+0x20/0x80

If NUMA is selected numa_setup_memory() will fix the node assignments
before the vmemmap will be populated; so this warning will only appear
if NUMA is not selected.

To fix this simply use memblock_add_node() and re-add crash kernel
memory explicitly to node 0.

Reported-and-tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Fixes: 4e042af463f8 ("s390/kexec: fix crash on resize of reserved memory")
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/s390/kernel/setup.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -445,7 +445,7 @@ static void __init setup_resources(void)
 	 * part of the System RAM resource.
 	 */
 	if (crashk_res.end) {
-		memblock_add(crashk_res.start, resource_size(&crashk_res));
+		memblock_add_node(crashk_res.start, resource_size(&crashk_res), 0);
 		memblock_reserve(crashk_res.start, resource_size(&crashk_res));
 		insert_resource(&iomem_resource, &crashk_res);
 	}

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.8 00/96] 4.8.17-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  [PATCH 4.8 17/96] hv: acquire vmbus_connection.channel_mutex in vmbus_free_channels() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  [PATCH 4.8 52/96] s390/kexec: use node 0 when re-adding crash kernel memory Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  [PATCH 4.8 26/96] drm/nouveau/ltc: protect clearing of comptags with mutex Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  [PATCH 4.8 03/96] perf/x86: Fix exclusion of BTS and LBR for Goldmont Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  [PATCH 4.8 53/96] arm64: KVM: pmu: Reset PMSELR_EL0.SEL to a sane value before entering the guest Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  [PATCH 4.8 06/96] cfg80211/mac80211: fix BSS leaks when abandoning assoc attempts Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  [PATCH 4.8 55/96] md/raid5: limit request size according to implementation limits Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-01-07 00:10 +0100
  Re: [PATCH 4.8 00/96] 4.8.17-stable review Shuah Khan <shuah.kh@samsung.com> - 2017-01-07 03:10 +0100
  Re: [PATCH 4.8 00/96] 4.8.17-stable review Guenter Roeck <linux@roeck-us.net> - 2017-01-07 17:00 +0100

csiph-web