aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2006-10-11 04:21:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 14:14:19 -0400
commitdafb13673c463bc2aade4a4819704dde0f5fa37f (patch)
tree4944daaa4ca8e9d988e4357ae902fda6ea531d28
parent699397499742d1245ea5d677a08fa265df666d2d (diff)
[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>
-rw-r--r--mm/page_alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8246e834b2f0..c5caac2c3c5a 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)
495 int i; 495 int i;
496 int reserved = 0; 496 int reserved = 0;
497 497
498 arch_free_page(page, order);
499 if (!PageHighMem(page)) 498 if (!PageHighMem(page))
500 debug_check_no_locks_freed(page_address(page), 499 debug_check_no_locks_freed(page_address(page),
501 PAGE_SIZE<<order); 500 PAGE_SIZE<<order);
@@ -505,7 +504,9 @@ static void __free_pages_ok(struct page *page, unsigned int order)
505 if (reserved) 504 if (reserved)
506 return; 505 return;
507 506
507 arch_free_page(page, order);
508 kernel_map_pages(page, 1 << order, 0); 508 kernel_map_pages(page, 1 << order, 0);
509
509 local_irq_save(flags); 510 local_irq_save(flags);
510 __count_vm_events(PGFREE, 1 << order); 511 __count_vm_events(PGFREE, 1 << order);
511 free_one_page(page_zone(page), page, order); 512 free_one_page(page_zone(page), page, order);
@@ -781,13 +782,12 @@ static void fastcall free_hot_cold_page(struct page *page, int cold)
781 struct per_cpu_pages *pcp; 782 struct per_cpu_pages *pcp;
782 unsigned long flags; 783 unsigned long flags;
783 784
784 arch_free_page(page, 0);
785
786 if (PageAnon(page)) 785 if (PageAnon(page))
787 page->mapping = NULL; 786 page->mapping = NULL;
788 if (free_pages_check(page)) 787 if (free_pages_check(page))
789 return; 788 return;
790 789
790 arch_free_page(page, 0);
791 kernel_map_pages(page, 1, 0); 791 kernel_map_pages(page, 1, 0);
792 792
793 pcp = &zone_pcp(zone, get_cpu())->pcp[cold]; 793 pcp = &zone_pcp(zone, get_cpu())->pcp[cold];