OSDN Git Service

x86, mm: Add alloc_low_pages(num)
authorYinghai Lu <yinghai@kernel.org>
Sat, 17 Nov 2012 03:39:04 +0000 (19:39 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Sat, 17 Nov 2012 19:59:27 +0000 (11:59 -0800)
commit22c8ca2ac256bb681be791858b35502b5d37e73b
tree7eab01f0ad05e228f9d9c01da85503e6fafdb4f2
parent6f80b68e9e515547edbacb0c37491730bf766db5
x86, mm: Add alloc_low_pages(num)

32bit kmap mapping needs pages to be used for low to high.
At this point those pages are still from pgt_buf_* from BRK, so it is
ok now.
But we want to move early_ioremap_page_table_range_init() out of
init_memory_mapping() and only call it one time later, that will
make page_table_range_init/page_table_kmap_check/alloc_low_page to
use memblock to get page.

memblock allocation for pages are from high to low.
So will get panic from page_table_kmap_check() that has BUG_ON to do
ordering checking.

This patch add alloc_low_pages to make it possible to allocate serveral
pages at first, and hand out pages one by one from low to high.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1353123563-3103-28-git-send-email-yinghai@kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
arch/x86/mm/init.c
arch/x86/mm/mm_internal.h