diff options
author | Nick Piggin <npiggin@suse.de> | 2006-10-11 01:21:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 11:14:19 -0700 |
commit | dafb13673c463bc2aade4a4819704dde0f5fa37f (patch) | |
tree | 4944daaa4ca8e9d988e4357ae902fda6ea531d28 /mm/page_alloc.c | |
parent | 699397499742d1245ea5d677a08fa265df666d2d (diff) | |
download | op-kernel-dev-dafb13673c463bc2aade4a4819704dde0f5fa37f.zip op-kernel-dev-dafb13673c463bc2aade4a4819704dde0f5fa37f.tar.gz |
[PATCH] mm: arch_free_page fix
After the PG_reserved check was added, arch_free_page was being called in the
wrong place (it could be called for a page we don't actually want to free).
Fix that.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 8246e83..c5caac2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -495,7 +495,6 @@ static void __free_pages_ok(struct page *page, unsigned int order) int i; int reserved = 0; - arch_free_page(page, order); if (!PageHighMem(page)) debug_check_no_locks_freed(page_address(page), PAGE_SIZE<<order); @@ -505,7 +504,9 @@ static void __free_pages_ok(struct page *page, unsigned int order) if (reserved) return; + arch_free_page(page, order); kernel_map_pages(page, 1 << order, 0); + local_irq_save(flags); __count_vm_events(PGFREE, 1 << order); free_one_page(page_zone(page), page, order); @@ -781,13 +782,12 @@ static void fastcall free_hot_cold_page(struct page *page, int cold) struct per_cpu_pages *pcp; unsigned long flags; - arch_free_page(page, 0); - if (PageAnon(page)) page->mapping = NULL; if (free_pages_check(page)) return; + arch_free_page(page, 0); kernel_map_pages(page, 1, 0); pcp = &zone_pcp(zone, get_cpu())->pcp[cold]; |