diff mbox

[v2,1/1] sparc64: Do not change num_physpages during initmem freeing

Message ID 757251363741928@web15e.yandex.ru
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Kirill Tkhai March 20, 2013, 1:12 a.m. UTC
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.

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: David Miller <davem@davemloft.net>
CC: Sam Ravnborg <sam@ravnborg.org>
---
 arch/sparc/mm/init_64.c |    2 --
 1 file changed, 2 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller March 20, 2013, 6:42 p.m. UTC | #1
From: Kirill Tkhai <tkhai@yandex.ru>
Date: Wed, 20 Mar 2013 05:12:08 +0400

> 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.
> 
> Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sam Ravnborg March 20, 2013, 8:14 p.m. UTC | #2
On Wed, Mar 20, 2013 at 02:42:07PM -0400, David Miller wrote:
> From: Kirill Tkhai <tkhai@yandex.ru>
> Date: Wed, 20 Mar 2013 05:12:08 +0400
> 
> > 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.
> > 
> > Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
> 
> 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
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 5c2c6e6..d3f8506 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -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++;
 	}
 }