x86/mm: Fix the size calculation of mapping tables
authorWANG Cong <xiyou.wangcong@gmail.com>
Mon, 5 Mar 2012 23:05:13 +0000 (15:05 -0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 6 Mar 2012 08:38:26 +0000 (09:38 +0100)
commit722bc6b16771ed80871e1fd81c86d3627dda2ac8
treecfad3c8a90d44a548603c28fb9387bd2021f7a34
parent550cf00dbc8ee402bef71628cb71246493dd4500
x86/mm: Fix the size calculation of mapping tables

For machines that enable PSE, the first 2/4M memory region still uses
4K pages, so needs more PTEs in this case, but
find_early_table_space() doesn't count this.

This patch fixes it.

The bug was found via code review, no misbehavior of the kernel
was observed.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: <ianfang.cn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/n/tip-kq6a00qe33h7c7ais2xsywnh@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/mm/init.c