Skip to contentSkip to conversation

sparc64: Do not change num_physpages during initmem freeing

PATCH Applied Kirill Tkhai 3 participants 3 messages Mar 20, 2013 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 sparc64: Do not change num_physpages during initmem freeing

Common hibernation code looks at num_physpages during suspend and restore. Restore is able to be called from initcall, which is before initmem freeing. This case leads to restore fail.

CC David Miller <[email protected]>
CC Sam Ravnborg <[email protected]>
---
 arch/sparc/mm/init_64.c |    2 --
 1 file changed, 2 deletions(-)
arch/sparc/mm/init_64.c +0 -2
index 5c2c6e6..d3f8506 100644
@@ -2125,7 +2125,6 @@ void free_initmem(void)
 			ClearPageReserved(p);
 			init_page_count(p);
 			__free_page(p);
-			num_physpages++;
 			totalram_pages++;
 		}
 	}
@@ -2142,7 +2141,6 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 		ClearPageReserved(p);
 		init_page_count(p);
 		__free_page(p);
-		num_physpages++;
 		totalram_pages++;
 	}
 }
maintainer Applied
#1 lore raw

From: Kirill Tkhai <[email protected]>
Date: Wed, 20 Mar 2013 05:12:08 +0400

Quoted 5 lines

Common hibernation code looks at num_physpages during suspend and restore. Restore is able to be called from initcall, which is before initmem freeing. This case leads to restore fail.

Applied.

#2 lore raw
In reply to Kirill Tkhai
Quoted 10 lines · David Miller

From: Kirill Tkhai <[email protected]>
Date: Wed, 20 Mar 2013 05:12:08 +0400

Quoted 5 lines

Common hibernation code looks at num_physpages during suspend and restore. Restore is able to be called from initcall, which is before initmem freeing. This case leads to restore fail.

Applied.

Btw. I expect this patch to introduce some trivial conflict with a patch in Andrew's queue which cleans up some memory management stuff.

This: "mm/SPARC: use common help functions to free reserved pages"

Just so we are prepared when it happens.
Stephen will tell us...

Sam