summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@fedoraproject.org>2014-02-04 07:40:56 -0500
committerJosh Boyer <jwboyer@fedoraproject.org>2014-02-04 07:40:56 -0500
commitf6adf8acf2ae6b1f67319427911425c70b95c004 (patch)
tree5db40cf08b4b0df7d06301c551862d1dda5da02c
parent5b159e4dd6ebe87db94ed4118899b94624deaa0a (diff)
downloadkernel-f6adf8acf2ae6b1f67319427911425c70b95c004.tar.gz
kernel-f6adf8acf2ae6b1f67319427911425c70b95c004.tar.xz
kernel-f6adf8acf2ae6b1f67319427911425c70b95c004.zip
Add NUMA oops patches
- Reenable debugging options.
-rw-r--r--config-generic8
-rw-r--r--config-nodebug114
-rw-r--r--config-x86-generic2
-rw-r--r--kernel.spec14
-rw-r--r--tang-numa-1.patch83
-rw-r--r--tang-numa-2.patch132
6 files changed, 289 insertions, 64 deletions
diff --git a/config-generic b/config-generic
index 4e6026dea..4aea53ed1 100644
--- a/config-generic
+++ b/config-generic
@@ -1660,13 +1660,13 @@ CONFIG_B43_SDIO=y
CONFIG_B43_BCMA=y
# CONFIG_B43_BCMA_EXTRA is not set
CONFIG_B43_BCMA_PIO=y
-# CONFIG_B43_DEBUG is not set
+CONFIG_B43_DEBUG=y
CONFIG_B43_PHY_LP=y
CONFIG_B43_PHY_N=y
CONFIG_B43_PHY_HT=y
# CONFIG_B43_FORCE_PIO is not set
CONFIG_B43LEGACY=m
-# CONFIG_B43LEGACY_DEBUG is not set
+CONFIG_B43LEGACY_DEBUG=y
CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
CONFIG_B43LEGACY_DMA_AND_PIO_MODE=y
@@ -3500,7 +3500,7 @@ CONFIG_USB_STORAGE_REALTEK=m
CONFIG_REALTEK_AUTOPM=y
CONFIG_USB_STORAGE_ENE_UB6250=m
# CONFIG_USB_LIBUSUAL is not set
-# CONFIG_USB_UAS is not set
+CONFIG_USB_UAS=m
#
@@ -4568,7 +4568,7 @@ CONFIG_PM_DEBUG=y
# CONFIG_DPM_WATCHDOG is not set # revisit this in debug
CONFIG_PM_TRACE=y
CONFIG_PM_TRACE_RTC=y
-# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_PM_TEST_SUSPEND=y
CONFIG_PM_RUNTIME=y
# CONFIG_PM_OPP is not set
# CONFIG_PM_AUTOSLEEP is not set
diff --git a/config-nodebug b/config-nodebug
index ee4842bfc..9d4b2e91f 100644
--- a/config-nodebug
+++ b/config-nodebug
@@ -2,98 +2,98 @@ CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
CONFIG_SND_PCM_XRUN_DEBUG=y
-# CONFIG_DEBUG_ATOMIC_SLEEP is not set
-
-# CONFIG_DEBUG_MUTEXES is not set
-# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
-# CONFIG_DEBUG_RT_MUTEXES is not set
-# CONFIG_DEBUG_LOCK_ALLOC is not set
-# CONFIG_PROVE_LOCKING is not set
-# CONFIG_DEBUG_SPINLOCK is not set
-# CONFIG_PROVE_RCU is not set
+CONFIG_DEBUG_ATOMIC_SLEEP=y
+
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
+CONFIG_DEBUG_RT_MUTEXES=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_PROVE_LOCKING=y
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_PROVE_RCU=y
# CONFIG_PROVE_RCU_REPEATEDLY is not set
-# CONFIG_DEBUG_PER_CPU_MAPS is not set
+CONFIG_DEBUG_PER_CPU_MAPS=y
CONFIG_CPUMASK_OFFSTACK=y
-# CONFIG_CPU_NOTIFIER_ERROR_INJECT is not set
+CONFIG_CPU_NOTIFIER_ERROR_INJECT=m
-# CONFIG_FAULT_INJECTION is not set
-# CONFIG_FAILSLAB is not set
-# CONFIG_FAIL_PAGE_ALLOC is not set
-# CONFIG_FAIL_MAKE_REQUEST is not set
-# CONFIG_FAULT_INJECTION_DEBUG_FS is not set
-# CONFIG_FAULT_INJECTION_STACKTRACE_FILTER is not set
-# CONFIG_FAIL_IO_TIMEOUT is not set
-# CONFIG_FAIL_MMC_REQUEST is not set
+CONFIG_FAULT_INJECTION=y
+CONFIG_FAILSLAB=y
+CONFIG_FAIL_PAGE_ALLOC=y
+CONFIG_FAIL_MAKE_REQUEST=y
+CONFIG_FAULT_INJECTION_DEBUG_FS=y
+CONFIG_FAULT_INJECTION_STACKTRACE_FILTER=y
+CONFIG_FAIL_IO_TIMEOUT=y
+CONFIG_FAIL_MMC_REQUEST=y
-# CONFIG_LOCK_STAT is not set
+CONFIG_LOCK_STAT=y
-# CONFIG_DEBUG_STACK_USAGE is not set
+CONFIG_DEBUG_STACK_USAGE=y
-# CONFIG_ACPI_DEBUG is not set
+CONFIG_ACPI_DEBUG=y
# CONFIG_ACPI_DEBUG_FUNC_TRACE is not set
-# CONFIG_DEBUG_SG is not set
+CONFIG_DEBUG_SG=y
# CONFIG_DEBUG_PAGEALLOC is not set
-# CONFIG_DEBUG_WRITECOUNT is not set
-# CONFIG_DEBUG_OBJECTS is not set
+CONFIG_DEBUG_WRITECOUNT=y
+CONFIG_DEBUG_OBJECTS=y
# CONFIG_DEBUG_OBJECTS_SELFTEST is not set
-# CONFIG_DEBUG_OBJECTS_FREE is not set
-# CONFIG_DEBUG_OBJECTS_TIMERS is not set
-# CONFIG_DEBUG_OBJECTS_RCU_HEAD is not set
+CONFIG_DEBUG_OBJECTS_FREE=y
+CONFIG_DEBUG_OBJECTS_TIMERS=y
+CONFIG_DEBUG_OBJECTS_RCU_HEAD=y
CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
-# CONFIG_X86_PTDUMP is not set
+CONFIG_X86_PTDUMP=y
-# CONFIG_CAN_DEBUG_DEVICES is not set
+CONFIG_CAN_DEBUG_DEVICES=y
-# CONFIG_MODULE_FORCE_UNLOAD is not set
+CONFIG_MODULE_FORCE_UNLOAD=y
-# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_SYSCTL_SYSCALL_CHECK=y
-# CONFIG_DEBUG_NOTIFIERS is not set
+CONFIG_DEBUG_NOTIFIERS=y
-# CONFIG_DMA_API_DEBUG is not set
+CONFIG_DMA_API_DEBUG=y
-# CONFIG_MMIOTRACE is not set
+CONFIG_MMIOTRACE=y
-# CONFIG_DEBUG_CREDENTIALS is not set
+CONFIG_DEBUG_CREDENTIALS=y
# off in both production debug and nodebug builds,
# on in rawhide nodebug builds
-# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
-# CONFIG_EXT4_DEBUG is not set
+CONFIG_EXT4_DEBUG=y
# CONFIG_XFS_WARN is not set
-# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
+CONFIG_DEBUG_PERF_USE_VMALLOC=y
-# CONFIG_JBD2_DEBUG is not set
+CONFIG_JBD2_DEBUG=y
-# CONFIG_NFSD_FAULT_INJECTION is not set
+CONFIG_NFSD_FAULT_INJECTION=y
-# CONFIG_DEBUG_BLK_CGROUP is not set
+CONFIG_DEBUG_BLK_CGROUP=y
-# CONFIG_DRBD_FAULT_INJECTION is not set
+CONFIG_DRBD_FAULT_INJECTION=y
-# CONFIG_ATH_DEBUG is not set
-# CONFIG_CARL9170_DEBUGFS is not set
-# CONFIG_IWLWIFI_DEVICE_TRACING is not set
+CONFIG_ATH_DEBUG=y
+CONFIG_CARL9170_DEBUGFS=y
+CONFIG_IWLWIFI_DEVICE_TRACING=y
# CONFIG_RTLWIFI_DEBUG is not set
-# CONFIG_DEBUG_OBJECTS_WORK is not set
+CONFIG_DEBUG_OBJECTS_WORK=y
-# CONFIG_DMADEVICES_DEBUG is not set
-# CONFIG_DMADEVICES_VDEBUG is not set
+CONFIG_DMADEVICES_DEBUG=y
+CONFIG_DMADEVICES_VDEBUG=y
CONFIG_PM_ADVANCED_DEBUG=y
-# CONFIG_CEPH_LIB_PRETTYDEBUG is not set
-# CONFIG_QUOTA_DEBUG is not set
+CONFIG_CEPH_LIB_PRETTYDEBUG=y
+CONFIG_QUOTA_DEBUG=y
CONFIG_PCI_DEFAULT_USE_CRS=y
@@ -101,18 +101,18 @@ CONFIG_KGDB_KDB=y
CONFIG_KDB_KEYBOARD=y
CONFIG_KDB_CONTINUE_CATASTROPHIC=0
-# CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER is not set
+CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y
# CONFIG_PERCPU_TEST is not set
-# CONFIG_TEST_LIST_SORT is not set
+CONFIG_TEST_LIST_SORT=y
# CONFIG_TEST_STRING_HELPERS is not set
-# CONFIG_DETECT_HUNG_TASK is not set
+CONFIG_DETECT_HUNG_TASK=y
CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120
# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set
-# CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK is not set
+CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y
-# CONFIG_DEBUG_KMEMLEAK is not set
+CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE=1024
# CONFIG_DEBUG_KMEMLEAK_TEST is not set
CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y
@@ -123,7 +123,7 @@ CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y
# CONFIG_SPI_DEBUG is not set
-# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set
+CONFIG_X86_DEBUG_STATIC_CPU_HAS=y
# CONFIG_SCHEDSTATS is not set
# CONFIG_LATENCYTOP is not set
diff --git a/config-x86-generic b/config-x86-generic
index f6b3fa8c5..c44b81f3a 100644
--- a/config-x86-generic
+++ b/config-x86-generic
@@ -334,7 +334,7 @@ CONFIG_SP5100_TCO=m
# CONFIG_MEMTEST is not set
# CONFIG_DEBUG_TLBFLUSH is not set
-# CONFIG_MAXSMP is not set
+CONFIG_MAXSMP=y
CONFIG_HP_ILO=m
diff --git a/kernel.spec b/kernel.spec
index 883eef529..5182ffc88 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -34,7 +34,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
-%global baserelease 1
+%global baserelease 2
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@@ -122,7 +122,7 @@ Summary: The Linux kernel
# Set debugbuildsenabled to 1 for production (build separate debug kernels)
# and 0 for rawhide (all kernels are debug kernels).
# See also 'make debug' and 'make release'.
-%define debugbuildsenabled 1
+%define debugbuildsenabled 0
# Want to build a vanilla kernel build without any non-upstream patches?
%define with_vanilla %{?_with_vanilla: 1} %{?!_with_vanilla: 0}
@@ -630,6 +630,9 @@ Patch25191: kernfs-oops-fix.patch
Patch25192: imx-hdmi-fix.patch
Patch25193: fix-exynos-hdmi-build.patch
+Patch25194: tang-numa-1.patch
+Patch25915: tang-numa-2.patch
+
# END OF PATCH DEFINITIONS
%endif
@@ -1282,6 +1285,9 @@ ApplyPatch kernfs-oops-fix.patch
ApplyPatch imx-hdmi-fix.patch
ApplyPatch fix-exynos-hdmi-build.patch
+ApplyPatch tang-numa-1.patch
+ApplyPatch tang-numa-2.patch
+
# END OF PATCH APPLICATIONS
%endif
@@ -2061,6 +2067,10 @@ fi
# ||----w |
# || ||
%changelog
+* Tue Feb 04 2014 Josh Boyer <jwboyer@fedoraproject.org> - 3.14.0-0.rc1.git0.2
+- Add NUMA oops patches
+- Reenable debugging options.
+
* Mon Feb 03 2014 Josh Boyer <jwboyer@fedoraproject.org> - 3.14.0-0.rc1.git0.1
- Linux v3.14-rc1
- Disable debugging options.
diff --git a/tang-numa-1.patch b/tang-numa-1.patch
new file mode 100644
index 000000000..da29ce38e
--- /dev/null
+++ b/tang-numa-1.patch
@@ -0,0 +1,83 @@
+
+Delivered-To: jwboyer@gmail.com
+Received: by 10.76.27.197 with SMTP id v5csp13439oag;
+ Tue, 28 Jan 2014 01:11:29 -0800 (PST)
+X-Received: by 10.66.176.143 with SMTP id ci15mr352611pac.35.1390900288538;
+ Tue, 28 Jan 2014 01:11:28 -0800 (PST)
+Return-Path: <linux-kernel-owner@vger.kernel.org>
+Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
+ by mx.google.com with ESMTP id tq5si7486946pac.37.2014.01.28.01.10.46
+ for <multiple recipients>;
+ Tue, 28 Jan 2014 01:11:28 -0800 (PST)
+Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
+Authentication-Results: mx.google.com;
+ spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=linux-kernel-owner@vger.kernel.org
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1754836AbaA1JCw (ORCPT <rfc822;gardner.ben.linux@gmail.com>
+ + 99 others); Tue, 28 Jan 2014 04:02:52 -0500
+Received: from cn.fujitsu.com ([222.73.24.84]:26391 "EHLO song.cn.fujitsu.com"
+ rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP
+ id S1750855AbaA1JCt (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
+ Tue, 28 Jan 2014 04:02:49 -0500
+X-IronPort-AV: E=Sophos;i="4.95,735,1384272000";
+ d="scan'208";a="9461134"
+Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3])
+ by song.cn.fujitsu.com with ESMTP; 28 Jan 2014 16:59:01 +0800
+Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1])
+ by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s0S92ilt031286;
+ Tue, 28 Jan 2014 17:02:44 +0800
+Received: from G08FNSTD090432.fnst.cn.fujitsu.com ([10.167.226.99])
+ by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3)
+ with ESMTP id 2014012817011033-1418710 ;
+ Tue, 28 Jan 2014 17:01:10 +0800
+From: Tang Chen <tangchen@cn.fujitsu.com>
+To: davej@redhat.com, tglx@linutronix.de, mingo@redhat.com,
+ hpa@zytor.com, akpm@linux-foundation.org,
+ zhangyanfei@cn.fujitsu.com, guz.fnst@cn.fujitsu.com
+Cc: x86@kernel.org, linux-kernel@vger.kernel.org
+Subject: [PATCH 1/2] numa, mem-hotplug: Initialize numa_kernel_nodes in numa_clear_kernel_node_hotplug().
+Date: Tue, 28 Jan 2014 17:05:15 +0800
+Message-Id: <1390899916-23566-2-git-send-email-tangchen@cn.fujitsu.com>
+X-Mailer: git-send-email 1.7.11.7
+In-Reply-To: <1390899916-23566-1-git-send-email-tangchen@cn.fujitsu.com>
+References: <1390899916-23566-1-git-send-email-tangchen@cn.fujitsu.com>
+X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at
+ 2014/01/28 17:01:10,
+ Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at
+ 2014/01/28 17:01:10,
+ Serialize complete at 2014/01/28 17:01:10
+Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+
+On-stack variable numa_kernel_nodes in numa_clear_kernel_node_hotplug()
+was not initialized. So we need to initialize it.
+
+Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
+Tested-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
+---
+ arch/x86/mm/numa.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
+index 81b2750..00c9f09 100644
+--- a/arch/x86/mm/numa.c
++++ b/arch/x86/mm/numa.c
+@@ -569,6 +569,8 @@ static void __init numa_clear_kernel_node_hotplug(void)
+ unsigned long start, end;
+ struct memblock_type *type = &memblock.reserved;
+
++ nodes_clear(numa_kernel_nodes);
++
+ /* Mark all kernel nodes. */
+ for (i = 0; i < type->cnt; i++)
+ node_set(type->regions[i].nid, numa_kernel_nodes);
+--
+1.8.3.1
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at http://www.tux.org/lkml/
diff --git a/tang-numa-2.patch b/tang-numa-2.patch
new file mode 100644
index 000000000..f469bd432
--- /dev/null
+++ b/tang-numa-2.patch
@@ -0,0 +1,132 @@
+
+Delivered-To: jwboyer@gmail.com
+Received: by 10.76.27.197 with SMTP id v5csp13792oag;
+ Tue, 28 Jan 2014 01:18:26 -0800 (PST)
+X-Received: by 10.68.203.102 with SMTP id kp6mr520665pbc.14.1390900706562;
+ Tue, 28 Jan 2014 01:18:26 -0800 (PST)
+Return-Path: <linux-kernel-owner@vger.kernel.org>
+Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67])
+ by mx.google.com with ESMTP id fl7si14540600pad.345.2014.01.28.01.17.52
+ for <multiple recipients>;
+ Tue, 28 Jan 2014 01:18:26 -0800 (PST)
+Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67;
+Authentication-Results: mx.google.com;
+ spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mail=linux-kernel-owner@vger.kernel.org
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1754809AbaA1JD6 (ORCPT <rfc822;gardner.ben.linux@gmail.com>
+ + 99 others); Tue, 28 Jan 2014 04:03:58 -0500
+Received: from cn.fujitsu.com ([222.73.24.84]:28048 "EHLO song.cn.fujitsu.com"
+ rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP
+ id S1750931AbaA1JCt (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
+ Tue, 28 Jan 2014 04:02:49 -0500
+X-IronPort-AV: E=Sophos;i="4.95,735,1384272000";
+ d="scan'208";a="9461135"
+Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3])
+ by song.cn.fujitsu.com with ESMTP; 28 Jan 2014 16:59:02 +0800
+Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1])
+ by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s0S92ilu031286;
+ Tue, 28 Jan 2014 17:02:45 +0800
+Received: from G08FNSTD090432.fnst.cn.fujitsu.com ([10.167.226.99])
+ by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3)
+ with ESMTP id 2014012817011055-1418712 ;
+ Tue, 28 Jan 2014 17:01:10 +0800
+From: Tang Chen <tangchen@cn.fujitsu.com>
+To: davej@redhat.com, tglx@linutronix.de, mingo@redhat.com,
+ hpa@zytor.com, akpm@linux-foundation.org,
+ zhangyanfei@cn.fujitsu.com, guz.fnst@cn.fujitsu.com
+Cc: x86@kernel.org, linux-kernel@vger.kernel.org
+Subject: [PATCH 2/2] numa, mem-hotplug: Fix array index overflow when synchronizing nid to memblock.reserved.
+Date: Tue, 28 Jan 2014 17:05:16 +0800
+Message-Id: <1390899916-23566-3-git-send-email-tangchen@cn.fujitsu.com>
+X-Mailer: git-send-email 1.7.11.7
+In-Reply-To: <1390899916-23566-1-git-send-email-tangchen@cn.fujitsu.com>
+References: <1390899916-23566-1-git-send-email-tangchen@cn.fujitsu.com>
+X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at
+ 2014/01/28 17:01:10,
+ Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at
+ 2014/01/28 17:01:11,
+ Serialize complete at 2014/01/28 17:01:11
+Sender: linux-kernel-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-kernel.vger.kernel.org>
+X-Mailing-List: linux-kernel@vger.kernel.org
+
+The following path will cause array out of bound.
+
+memblock_add_region() will always set nid in memblock.reserved to MAX_NUMNODES.
+In numa_register_memblks(), after we set all nid to correct valus in memblock.reserved,
+we called setup_node_data(), and used memblock_alloc_nid() to allocate memory, with
+nid set to MAX_NUMNODES.
+
+The nodemask_t type can be seen as a bit array. And the index is 0 ~ MAX_NUMNODES-1.
+
+After that, when we call node_set() in numa_clear_kernel_node_hotplug(), the nodemask_t
+got an index of value MAX_NUMNODES, which is out of [0 ~ MAX_NUMNODES-1].
+
+See below:
+
+numa_init()
+ |---> numa_register_memblks()
+ | |---> memblock_set_node(memory) set correct nid in memblock.memory
+ | |---> memblock_set_node(reserved) set correct nid in memblock.reserved
+ | |......
+ | |---> setup_node_data()
+ | |---> memblock_alloc_nid() here, nid is set to MAX_NUMNODES (1024)
+ |......
+ |---> numa_clear_kernel_node_hotplug()
+ |---> node_set() here, we have an index 1024, and overflowed
+
+This patch moves nid setting to numa_clear_kernel_node_hotplug() to fix this problem.
+
+Reported-by: Dave Jones <davej@redhat.com>
+Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
+Tested-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
+---
+ arch/x86/mm/numa.c | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
+index 00c9f09..a183b43 100644
+--- a/arch/x86/mm/numa.c
++++ b/arch/x86/mm/numa.c
+@@ -493,14 +493,6 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
+ struct numa_memblk *mb = &mi->blk[i];
+ memblock_set_node(mb->start, mb->end - mb->start,
+ &memblock.memory, mb->nid);
+-
+- /*
+- * At this time, all memory regions reserved by memblock are
+- * used by the kernel. Set the nid in memblock.reserved will
+- * mark out all the nodes the kernel resides in.
+- */
+- memblock_set_node(mb->start, mb->end - mb->start,
+- &memblock.reserved, mb->nid);
+ }
+
+ /*
+@@ -571,6 +563,17 @@ static void __init numa_clear_kernel_node_hotplug(void)
+
+ nodes_clear(numa_kernel_nodes);
+
++ /*
++ * At this time, all memory regions reserved by memblock are
++ * used by the kernel. Set the nid in memblock.reserved will
++ * mark out all the nodes the kernel resides in.
++ */
++ for (i = 0; i < numa_meminfo.nr_blks; i++) {
++ struct numa_memblk *mb = &numa_meminfo.blk[i];
++ memblock_set_node(mb->start, mb->end - mb->start,
++ &memblock.reserved, mb->nid);
++ }
++
+ /* Mark all kernel nodes. */
+ for (i = 0; i < type->cnt; i++)
+ node_set(type->regions[i].nid, numa_kernel_nodes);
+--
+1.8.3.1
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+Please read the FAQ at http://www.tux.org/lkml/