[POWERPC] Fix handling of memreserve if the range lands in highmem
authorKumar Gala <galak@kernel.crashing.org>
Wed, 9 Jan 2008 17:27:23 +0000 (11:27 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Thu, 24 Jan 2008 01:29:08 +0000 (19:29 -0600)
commitf98eeb4eb1c52de89dcefeb538029bcecc6dd42d
treeda91da9e329d35360ece38eb7f9fbcbc740cec63
parent52920df4aa9dd25836b8ed4dc0b177ea14c09e53
[POWERPC] Fix handling of memreserve if the range lands in highmem

There were several issues if a memreserve range existed and happened
to be in highmem:

* The bootmem allocator is only aware of lowmem so calling
  reserve_bootmem with a highmem address would cause a BUG_ON
* All highmem pages were provided to the buddy allocator

Added a lmb_is_reserved() api that we now use to determine if a highem
page should continue to be PageReserved or provided to the buddy
allocator.

Also, we incorrectly reported the amount of pages reserved since all
highmem pages are initally marked reserved and we clear the
PageReserved flag as we "free" up the highmem pages.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/mm/lmb.c
arch/powerpc/mm/mem.c
include/asm-powerpc/lmb.h