Commit dafb1367 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds
Browse files

[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: default avatarNick Piggin <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 69939749
......@@ -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))
......@@ -505,7 +504,9 @@ static void __free_pages_ok(struct page *page, unsigned int order)
if (reserved)
arch_free_page(page, order);
kernel_map_pages(page, 1 << order, 0);
__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))
arch_free_page(page, 0);
kernel_map_pages(page, 1, 0);
pcp = &zone_pcp(zone, get_cpu())->pcp[cold];
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment