diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2008-01-09 12:27:23 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-01-23 20:29:08 -0500 |
commit | f98eeb4eb1c52de89dcefeb538029bcecc6dd42d (patch) | |
tree | da91da9e329d35360ece38eb7f9fbcbc740cec63 /arch/powerpc/mm/lmb.c | |
parent | 52920df4aa9dd25836b8ed4dc0b177ea14c09e53 (diff) |
[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>
Diffstat (limited to 'arch/powerpc/mm/lmb.c')
-rw-r--r-- | arch/powerpc/mm/lmb.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c index 8f4d2dc4cafb..4ce23bcf8a57 100644 --- a/arch/powerpc/mm/lmb.c +++ b/arch/powerpc/mm/lmb.c | |||
@@ -342,3 +342,16 @@ void __init lmb_enforce_memory_limit(unsigned long memory_limit) | |||
342 | } | 342 | } |
343 | } | 343 | } |
344 | } | 344 | } |
345 | |||
346 | int __init lmb_is_reserved(unsigned long addr) | ||
347 | { | ||
348 | int i; | ||
349 | |||
350 | for (i = 0; i < lmb.reserved.cnt; i++) { | ||
351 | unsigned long upper = lmb.reserved.region[i].base + | ||
352 | lmb.reserved.region[i].size - 1; | ||
353 | if ((addr >= lmb.reserved.region[i].base) && (addr <= upper)) | ||
354 | return 1; | ||
355 | } | ||
356 | return 0; | ||
357 | } | ||