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

login
register
mail settings
Submitter Kirill Tkhai
Date March 20, 2013, 1:12 a.m.
Message ID <757251363741928@web15e.yandex.ru>
Download mbox | patch
Permalink /patch/229237/
State Accepted
Delegated to: David Miller
Headers show

Comments

Kirill Tkhai - March 20, 2013, 1:12 a.m.
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
David Miller - March 20, 2013, 6:42 p.m.
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.
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

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++;
 	}
 }