summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-01-26 14:11:02 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-01-26 14:11:13 +0100
commit9f4b0ba81f158df459fa2cfc98ab1475c090f29c (patch)
treef51ae243ddb99496dbdc4df65e217e090fb1b03c /arch/s390
parent5c699714d01ac358c58be9943234081b36b69cdd (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/Kconfig3
-rw-r--r--arch/s390/kernel/setup.c25
-rw-r--r--arch/s390/mm/vmem.c2
3 files changed, 25 insertions, 5 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 1330061020a..6ef54d27fc0 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -276,9 +276,6 @@ source "kernel/Kconfig.preempt"
source "mm/Kconfig"
-config HOLES_IN_ZONE
- def_bool y
-
comment "I/O subsystem configuration"
config MACHCHK_WARNING
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index d071a81b62d..3a61bfc2c4f 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -559,7 +559,9 @@ setup_resources(void)
data_resource.start = (unsigned long) &_etext;
data_resource.end = (unsigned long) &_edata - 1;
- for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {
+ for (i = 0; i < MEMORY_CHUNKS; i++) {
+ if (!memory_chunk[i].size)
+ continue;
res = alloc_bootmem_low(sizeof(struct resource));
res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
switch (memory_chunk[i].type) {
@@ -630,6 +632,27 @@ static void __init setup_memory_end(void)
max_mem = memory_end ? min(VMALLOC_START, memory_end) : VMALLOC_START;
memory_end = min(max_mem, memory_end);
+ /*
+ * Make sure all chunks are MAX_ORDER aligned so we don't need the
+ * extra checks that HOLES_IN_ZONE would require.
+ */
+ for (i = 0; i < MEMORY_CHUNKS; i++) {
+ unsigned long start, end;
+ struct mem_chunk *chunk;
+ unsigned long align;
+
+ chunk = &memory_chunk[i];
+ align = 1UL << (MAX_ORDER + PAGE_SHIFT - 1);
+ start = (chunk->addr + align - 1) & ~(align - 1);
+ end = (chunk->addr + chunk->size) & ~(align - 1);
+ if (start >= end)
+ memset(chunk, 0, sizeof(*chunk));
+ else {
+ chunk->addr = start;
+ chunk->size = end - start;
+ }
+ }
+
for (i = 0; i < MEMORY_CHUNKS; i++) {
struct mem_chunk *chunk = &memory_chunk[i];
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index ee625c8c3b2..1fc99891c4e 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)
int i;
mutex_lock(&vmem_mutex);
- for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {
+ for (i = 0; i < MEMORY_CHUNKS; i++) {
if (!memory_chunk[i].size)
continue;
seg = kzalloc(sizeof(*seg), GFP_KERNEL);