diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-01-26 08:11:02 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:11:13 -0500 |
commit | 9f4b0ba81f158df459fa2cfc98ab1475c090f29c (patch) | |
tree | f51ae243ddb99496dbdc4df65e217e090fb1b03c /arch/s390 | |
parent | 5c699714d01ac358c58be9943234081b36b69cdd (diff) |
[S390] Get rid of HOLES_IN_ZONE requirement.
Align everything to MAX_ORDER so we can get rid of the extra checks.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/Kconfig | 3 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 25 | ||||
-rw-r--r-- | arch/s390/mm/vmem.c | 2 |
3 files changed, 25 insertions, 5 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 1330061020ab..6ef54d27fc00 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -276,9 +276,6 @@ source "kernel/Kconfig.preempt" | |||
276 | 276 | ||
277 | source "mm/Kconfig" | 277 | source "mm/Kconfig" |
278 | 278 | ||
279 | config HOLES_IN_ZONE | ||
280 | def_bool y | ||
281 | |||
282 | comment "I/O subsystem configuration" | 279 | comment "I/O subsystem configuration" |
283 | 280 | ||
284 | config MACHCHK_WARNING | 281 | config MACHCHK_WARNING |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index d071a81b62da..3a61bfc2c4fb 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -559,7 +559,9 @@ setup_resources(void) | |||
559 | data_resource.start = (unsigned long) &_etext; | 559 | data_resource.start = (unsigned long) &_etext; |
560 | data_resource.end = (unsigned long) &_edata - 1; | 560 | data_resource.end = (unsigned long) &_edata - 1; |
561 | 561 | ||
562 | for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { | 562 | for (i = 0; i < MEMORY_CHUNKS; i++) { |
563 | if (!memory_chunk[i].size) | ||
564 | continue; | ||
563 | res = alloc_bootmem_low(sizeof(struct resource)); | 565 | res = alloc_bootmem_low(sizeof(struct resource)); |
564 | res->flags = IORESOURCE_BUSY | IORESOURCE_MEM; | 566 | res->flags = IORESOURCE_BUSY | IORESOURCE_MEM; |
565 | switch (memory_chunk[i].type) { | 567 | switch (memory_chunk[i].type) { |
@@ -630,6 +632,27 @@ static void __init setup_memory_end(void) | |||
630 | max_mem = memory_end ? min(VMALLOC_START, memory_end) : VMALLOC_START; | 632 | max_mem = memory_end ? min(VMALLOC_START, memory_end) : VMALLOC_START; |
631 | memory_end = min(max_mem, memory_end); | 633 | memory_end = min(max_mem, memory_end); |
632 | 634 | ||
635 | /* | ||
636 | * Make sure all chunks are MAX_ORDER aligned so we don't need the | ||
637 | * extra checks that HOLES_IN_ZONE would require. | ||
638 | */ | ||
639 | for (i = 0; i < MEMORY_CHUNKS; i++) { | ||
640 | unsigned long start, end; | ||
641 | struct mem_chunk *chunk; | ||
642 | unsigned long align; | ||
643 | |||
644 | chunk = &memory_chunk[i]; | ||
645 | align = 1UL << (MAX_ORDER + PAGE_SHIFT - 1); | ||
646 | start = (chunk->addr + align - 1) & ~(align - 1); | ||
647 | end = (chunk->addr + chunk->size) & ~(align - 1); | ||
648 | if (start >= end) | ||
649 | memset(chunk, 0, sizeof(*chunk)); | ||
650 | else { | ||
651 | chunk->addr = start; | ||
652 | chunk->size = end - start; | ||
653 | } | ||
654 | } | ||
655 | |||
633 | for (i = 0; i < MEMORY_CHUNKS; i++) { | 656 | for (i = 0; i < MEMORY_CHUNKS; i++) { |
634 | struct mem_chunk *chunk = &memory_chunk[i]; | 657 | struct mem_chunk *chunk = &memory_chunk[i]; |
635 | 658 | ||
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index ee625c8c3b28..1fc99891c4eb 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c | |||
@@ -376,7 +376,7 @@ static int __init vmem_convert_memory_chunk(void) | |||
376 | int i; | 376 | int i; |
377 | 377 | ||
378 | mutex_lock(&vmem_mutex); | 378 | mutex_lock(&vmem_mutex); |
379 | for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) { | 379 | for (i = 0; i < MEMORY_CHUNKS; i++) { |
380 | if (!memory_chunk[i].size) | 380 | if (!memory_chunk[i].size) |
381 | continue; | 381 | continue; |
382 | seg = kzalloc(sizeof(*seg), GFP_KERNEL); | 382 | seg = kzalloc(sizeof(*seg), GFP_KERNEL); |