Messages in this thread | | | Date | Wed, 22 Jan 2014 22:05:20 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH] numa, mem-hotplug: Fix stack overflow in numa when seting kernel nodes to unhotpluggable. |
| |
On Thu, 23 Jan 2014 13:49:28 +0800 Tang Chen <tangchen@cn.fujitsu.com> wrote:
> Dave found that the kernel will hang during boot. This is because > the nodemask_t type stack variable numa_kernel_nodes is large enough > to overflow the stack. > > This doesn't always happen. According to Dave, this happened once > in about five boots. The backtrace is like the following: > > dump_stack > panic > ? numa_clear_kernel_node_hotplug > __stack_chk_fail > numa_clear_kernel_node_hotplug > ? memblock_search_pfn_nid > ? __early_pfn_to_nid > numa_init > x86_numa_init > initmem_init > setup_arch > start_kernel > > This patch fix this problem by defining numa_kernel_nodes as a > static global variable in __initdata area. > > ... > > --- a/arch/x86/mm/numa.c > +++ b/arch/x86/mm/numa.c > @@ -562,10 +562,10 @@ static void __init numa_init_array(void) > } > } > > +static nodemask_t numa_kernel_nodes __initdata; > static void __init numa_clear_kernel_node_hotplug(void) > { > int i, nid; > - nodemask_t numa_kernel_nodes; > unsigned long start, end; > struct memblock_type *type = &memblock.reserved;
Seems odd. The maximum size of a nodemask_t is 128 bytes, isn't it? If so, what the heck have we done in there to consume so much stack?
| |