diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2005-05-01 11:58:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:58:57 -0400 |
commit | c9e3735359ac2d74ee61c6f1e5724f4a6db570bf (patch) | |
tree | 381204a24f4378d3c8d898f8e0210b1b97f5f248 /arch/s390/mm/init.c | |
parent | 4b7e0706620e3947dc1685dfdbc1413404afb545 (diff) |
[PATCH] s390: fix memory holes and cleanup setup_arch
The memory setup didn't take care of memory holes and this makes the memory
management think there would be more memory available than there is in
reality. That causes the OOM killer to kill processes even if there is enough
memory left that can be written to the swap space.
The patch fixes this by using free_area_init_node with an array of memory
holes instead of free_area_init. Further the patch cleans up the code in
setup.c by splitting setup_arch into smaller pieces.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/s390/mm/init.c')
-rw-r--r-- | arch/s390/mm/init.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 8e723bc7f795..6ec5cd981e74 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -101,6 +101,7 @@ extern unsigned long _end; | |||
101 | extern unsigned long __init_begin; | 101 | extern unsigned long __init_begin; |
102 | extern unsigned long __init_end; | 102 | extern unsigned long __init_end; |
103 | 103 | ||
104 | extern unsigned long __initdata zholes_size[]; | ||
104 | /* | 105 | /* |
105 | * paging_init() sets up the page tables | 106 | * paging_init() sets up the page tables |
106 | */ | 107 | */ |
@@ -163,10 +164,13 @@ void __init paging_init(void) | |||
163 | local_flush_tlb(); | 164 | local_flush_tlb(); |
164 | 165 | ||
165 | { | 166 | { |
166 | unsigned long zones_size[MAX_NR_ZONES] = { 0, 0, 0}; | 167 | unsigned long zones_size[MAX_NR_ZONES]; |
167 | 168 | ||
169 | memset(zones_size, 0, sizeof(zones_size)); | ||
168 | zones_size[ZONE_DMA] = max_low_pfn; | 170 | zones_size[ZONE_DMA] = max_low_pfn; |
169 | free_area_init(zones_size); | 171 | free_area_init_node(0, &contig_page_data, zones_size, |
172 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, | ||
173 | zholes_size); | ||
170 | } | 174 | } |
171 | return; | 175 | return; |
172 | } | 176 | } |
@@ -184,9 +188,10 @@ void __init paging_init(void) | |||
184 | _KERN_REGION_TABLE; | 188 | _KERN_REGION_TABLE; |
185 | static const int ssm_mask = 0x04000000L; | 189 | static const int ssm_mask = 0x04000000L; |
186 | 190 | ||
187 | unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; | 191 | unsigned long zones_size[MAX_NR_ZONES]; |
188 | unsigned long dma_pfn, high_pfn; | 192 | unsigned long dma_pfn, high_pfn; |
189 | 193 | ||
194 | memset(zones_size, 0, sizeof(zones_size)); | ||
190 | dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT; | 195 | dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT; |
191 | high_pfn = max_low_pfn; | 196 | high_pfn = max_low_pfn; |
192 | 197 | ||
@@ -198,8 +203,8 @@ void __init paging_init(void) | |||
198 | } | 203 | } |
199 | 204 | ||
200 | /* Initialize mem_map[]. */ | 205 | /* Initialize mem_map[]. */ |
201 | free_area_init(zones_size); | 206 | free_area_init_node(0, &contig_page_data, zones_size, |
202 | 207 | __pa(PAGE_OFFSET) >> PAGE_SHIFT, zholes_size); | |
203 | 208 | ||
204 | /* | 209 | /* |
205 | * map whole physical memory to virtual memory (identity mapping) | 210 | * map whole physical memory to virtual memory (identity mapping) |