Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
9f4b0ba8 5c699714

+25 -5
-3
arch/s390/Kconfig
··· 276 276 277 277 source "mm/Kconfig" 278 278 279 - config HOLES_IN_ZONE 280 - def_bool y 281 - 282 279 comment "I/O subsystem configuration" 283 280 284 281 config MACHCHK_WARNING
+24 -1
arch/s390/kernel/setup.c
··· 559 559 data_resource.start = (unsigned long) &_etext; 560 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 565 res = alloc_bootmem_low(sizeof(struct resource)); 564 566 res->flags = IORESOURCE_BUSY | IORESOURCE_MEM; 565 567 switch (memory_chunk[i].type) { ··· 631 629 632 630 max_mem = memory_end ? min(VMALLOC_START, memory_end) : VMALLOC_START; 633 631 memory_end = min(max_mem, memory_end); 632 + 633 + /* 634 + * Make sure all chunks are MAX_ORDER aligned so we don't need the 635 + * extra checks that HOLES_IN_ZONE would require. 636 + */ 637 + for (i = 0; i < MEMORY_CHUNKS; i++) { 638 + unsigned long start, end; 639 + struct mem_chunk *chunk; 640 + unsigned long align; 641 + 642 + chunk = &memory_chunk[i]; 643 + align = 1UL << (MAX_ORDER + PAGE_SHIFT - 1); 644 + start = (chunk->addr + align - 1) & ~(align - 1); 645 + end = (chunk->addr + chunk->size) & ~(align - 1); 646 + if (start >= end) 647 + memset(chunk, 0, sizeof(*chunk)); 648 + else { 649 + chunk->addr = start; 650 + chunk->size = end - start; 651 + } 652 + } 634 653 635 654 for (i = 0; i < MEMORY_CHUNKS; i++) { 636 655 struct mem_chunk *chunk = &memory_chunk[i];
+1 -1
arch/s390/mm/vmem.c
··· 376 376 int i; 377 377 378 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 380 if (!memory_chunk[i].size) 381 381 continue; 382 382 seg = kzalloc(sizeof(*seg), GFP_KERNEL);