alloc_percpu: parse percpu= earlier.

Unfortunately my parsing changes won't make this window, so insert a
hack to grab percpu= parameter early enough to set up per-cpu areas.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Christoph Lameter <cl@linux-foundation.org>
---
 init/main.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/init/main.c b/init/main.c
--- a/init/main.c
+++ b/init/main.c
@@ -394,6 +394,12 @@ static void __init setup_per_cpu_areas(v
 	char *ptr;
 	unsigned long nr_possible_cpus = num_possible_cpus();
 
+	/* FIXME: core_param is too late, so grab percpu here. */
+	ptr = strstr(boot_command_line, "percpu=");
+	if (ptr)
+		percpu_reserve = simple_strtoul(ptr + strlen("percpu="),
+						NULL, 0);
+
 	/* Copy section for each CPU (we discard the original) */
 	size = ALIGN(PERCPU_ENOUGH_ROOM, PAGE_SIZE);
 	ptr = alloc_bootmem_pages(size * nr_possible_cpus);
