x86: reserve exact size of mptable
authorYinghai Lu <yinghai@kernel.org>
Wed, 4 Mar 2009 09:25:54 +0000 (01:25 -0800)
committerIngo Molnar <mingo@elte.hu>
Wed, 4 Mar 2009 19:55:04 +0000 (20:55 +0100)
Impact: save a bit of RAM

Get the exact size for the reserve_bootmem() call.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <49AE4922.605@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/mpparse.c

index ae9060cb4481dd9ab29e08aa50446e913495d0a4..e8192401da47e28c6a60d1c7d389257b19ca054a 100644 (file)
@@ -716,10 +716,10 @@ static int __init smp_scan_config(unsigned long base, unsigned long length,
 
                        if (!reserve)
                                return 1;
-                       reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE,
+                       reserve_bootmem_generic(virt_to_phys(mpf), sizeof(*mpf),
                                        BOOTMEM_DEFAULT);
                        if (mpf->physptr) {
-                               unsigned long size = PAGE_SIZE;
+                               unsigned long size = get_mpc_size(mpf->physptr);
 #ifdef CONFIG_X86_32
                                /*
                                 * We cannot access to MPC table to compute