x86: Cleanup highmap after brk is concluded
commitb9806bf136fb416a48aaff18dc271de0e75bbcf0
authorYinghai Lu <yinghai@kernel.org>
Fri, 18 Feb 2011 11:30:30 +0000 (18 11:30 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 28 Mar 2011 14:31:23 +0000 (28 07:31 -0700)
tree49144d425506b1d206b38c05f55abee13532123a
parent6997348a861d3540085bf9adf4166b86ac7a96e5
x86: Cleanup highmap after brk is concluded

commit e5f15b45ddf3afa2bbbb10c7ea34fb32b6de0a0e upstream.

Now cleanup_highmap actually is in two steps: one is early in head64.c
and only clears above _end; a second one is in init_memory_mapping() and
tries to clean from _brk_end to _end.
It should check if those boundaries are PMD_SIZE aligned but currently
does not.
Also init_memory_mapping() is called several times for numa or memory
hotplug, so we really should not handle initial kernel mappings there.

This patch moves cleanup_highmap() down after _brk_end is settled so
we can do everything in one step.
Also we honor max_pfn_mapped in the implementation of cleanup_highmap.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
LKML-Reference: <alpine.DEB.2.00.1103171739050.3382@kaball-desktop>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/head64.c
arch/x86/kernel/setup.c
arch/x86/mm/init.c
arch/x86/mm/init_64.c