x86, mm: Add global page_size_mask and probe one time only
authorYinghai Lu <yinghai@kernel.org>
Sat, 17 Nov 2012 03:38:38 +0000 (19:38 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Sat, 17 Nov 2012 19:59:00 +0000 (11:59 -0800)
commitfa62aafea9e415cd1efd8c4054106112fe809f19
treee85d6b6e3bd59bd4ffa8d055d065bbc6f38b694f
parentf4a75d2eb7b1e2206094b901be09adb31ba63681
x86, mm: Add global page_size_mask and probe one time only

Now we pass around use_gbpages and use_pse for calculating page table size,
Later we will need to call init_memory_mapping for every ram range one by one,
that mean those calculation will be done several times.

Those information are the same for all ram range and could be stored in
page_size_mask and could be probed it one time only.

Move that probing code out of init_memory_mapping into separated function
probe_page_size_mask(), and call it before all init_memory_mapping.

Suggested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1353123563-3103-2-git-send-email-yinghai@kernel.org
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/include/asm/pgtable.h
arch/x86/kernel/setup.c
arch/x86/mm/init.c