* [PATCH] powerpc: mark pages that don't exist as nosave
@ 2007-05-08 9:25 Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2007-05-08 9:25 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev list
On some powerpc architectures (notably 64-bit powermac) there is a memory
hole, for example on powermacs between 2G and 4G. Since we use the flat
memory model regardless, these pages must be marked as nosave (for suspend
to disk.)
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Tested on powerbook and G5 powermac, this patch is required for suspend
to disk on G5 as well due to the memory hole.
---
arch/powerpc/mm/mem.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
--- powerpc.orig/arch/powerpc/mm/mem.c 2007-05-08 11:18:12.279080051 +0200
+++ powerpc/arch/powerpc/mm/mem.c 2007-05-08 11:22:02.559080051 +0200
@@ -31,6 +31,7 @@
#include <linux/highmem.h>
#include <linux/initrd.h>
#include <linux/pagemap.h>
+#include <linux/suspend.h>
#include <asm/pgalloc.h>
#include <asm/prom.h>
@@ -276,6 +277,28 @@ void __init do_init_bootmem(void)
init_bootmem_done = 1;
}
+/* mark pages that don't exist as nosave */
+static int __init mark_nonram_nosave(void)
+{
+ unsigned long lmb_next_region_start_pfn,
+ lmb_region_max_pfn;
+ int i;
+
+ for (i = 0; i < lmb.memory.cnt - 1; i++) {
+ lmb_region_max_pfn =
+ (lmb.memory.region[i].base >> PAGE_SHIFT) +
+ (lmb.memory.region[i].size >> PAGE_SHIFT);
+ lmb_next_region_start_pfn =
+ lmb.memory.region[i+1].base >> PAGE_SHIFT;
+
+ if (lmb_region_max_pfn < lmb_next_region_start_pfn)
+ register_nosave_region(lmb_region_max_pfn,
+ lmb_next_region_start_pfn);
+ }
+
+ return 0;
+}
+
/*
* paging_init() sets up the page tables - in fact we've already done this.
*/
@@ -307,6 +330,8 @@ void __init paging_init(void)
max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
#endif
free_area_init_nodes(max_zone_pfns);
+
+ mark_nonram_nosave();
}
#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
^ permalink raw reply [flat|nested] 2+ messages in thread
* patches for 2.6.22
@ 2007-04-27 11:25 Paul Mackerras
2007-05-03 12:25 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2007-04-27 11:25 UTC (permalink / raw)
To: linuxppc-dev
I have pushed out some more patches to the for-2.6.22 branch of the
powerpc.git repository. I intend in the next couple of days to ask
Linus to pull that branch.
If anyone has patches that I haven't picked up yet which they think
should go into 2.6.22, please send me either a pointer to the
patches if previously posted to linuxppc-dev, or post them to
linuxppc-dev. Note that I don't read linuxppc-embedded, and I rely on
platform maintainers to forward any patches that are ready for
inclusion to me and the linuxppc-dev list.
I'm willing to take arch/ppc patches that fix bugs or generally keep
the existing platforms there working. I don't want to put large lumps
of new code in there, though.
Due to a mistake on my part (I put in the pasemi RNG driver) I have
had to rebase some of the patches in for-2.6.22 branch, so if you have
done a pull of the for-2.6.22 or master branches in the last 5 hours,
please do a pull -f to get the new set.
Paul.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: patches for 2.6.22
2007-04-27 11:25 patches for 2.6.22 Paul Mackerras
@ 2007-05-03 12:25 ` Johannes Berg
2007-05-03 12:29 ` [PATCH] powerpc: mark pages that don't exist as nosave Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2007-05-03 12:25 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
Hi,
I'll reply to this message with 3 more patches that I will send as soon
as akpm sends Rafael's swsusp patches from -mm to Linus. Please take a
look anyway, only some register_nosave_region{_late,}() calls are in
these patches that are not possible yet.
I'd love to have the G5 suspend merged even though nvidiafb still breaks
it, I do think it's a bug in nvidiafb and not the generic code.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] powerpc: mark pages that don't exist as nosave
2007-05-03 12:25 ` Johannes Berg
@ 2007-05-03 12:29 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2007-05-03 12:29 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
On some powerpc architectures (notably 64-bit powermac) there is a memory
hole, for example on powermacs between 2G and 4G. Since we use the flat
memory model regardless, these pages must be marked as nosave (for suspend
to disk.)
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
---
Tested on powerbook and G5 powermac.
---
arch/powerpc/mm/mem.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
--- wireless-dev.orig/arch/powerpc/mm/mem.c 2007-05-03 14:20:25.959165535 +0200
+++ wireless-dev/arch/powerpc/mm/mem.c 2007-05-03 14:21:09.659165535 +0200
@@ -31,6 +31,7 @@
#include <linux/highmem.h>
#include <linux/initrd.h>
#include <linux/pagemap.h>
+#include <linux/suspend.h>
#include <asm/pgalloc.h>
#include <asm/prom.h>
@@ -277,6 +278,28 @@ void __init do_init_bootmem(void)
init_bootmem_done = 1;
}
+/* mark pages that don't exist as nosave */
+static int __init mark_nonram_nosave(void)
+{
+ unsigned long lmb_next_region_start_pfn,
+ lmb_region_max_pfn;
+ int i;
+
+ for (i = 0; i < lmb.memory.cnt - 1; i++) {
+ lmb_region_max_pfn =
+ (lmb.memory.region[i].base >> PAGE_SHIFT) +
+ (lmb.memory.region[i].size >> PAGE_SHIFT);
+ lmb_next_region_start_pfn =
+ lmb.memory.region[i+1].base >> PAGE_SHIFT;
+
+ if (lmb_region_max_pfn < lmb_next_region_start_pfn)
+ register_nosave_region(lmb_region_max_pfn,
+ lmb_next_region_start_pfn);
+ }
+
+ return 0;
+}
+
/*
* paging_init() sets up the page tables - in fact we've already done this.
*/
@@ -308,6 +331,8 @@ void __init paging_init(void)
max_zone_pfns[ZONE_DMA] = top_of_ram >> PAGE_SHIFT;
#endif
free_area_init_nodes(max_zone_pfns);
+
+ mark_nonram_nosave();
}
#endif /* ! CONFIG_NEED_MULTIPLE_NODES */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-05-08 9:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08 9:25 [PATCH] powerpc: mark pages that don't exist as nosave Johannes Berg
-- strict thread matches above, loose matches on Subject: below --
2007-04-27 11:25 patches for 2.6.22 Paul Mackerras
2007-05-03 12:25 ` Johannes Berg
2007-05-03 12:29 ` [PATCH] powerpc: mark pages that don't exist as nosave Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).