Skip to content

Commit 5dbc4cb

Browse files
Vasily Gorbikhcahca
authored andcommitted
s390/setup: avoid using memblock_enforce_memory_limit
There is a difference in how architectures treat "mem=" option. For some that is an amount of online memory, for s390 and x86 this is the limiting max address. Some memblock api like memblock_enforce_memory_limit() take limit argument and explicitly treat it as the size of online memory, and use __find_max_addr to convert it to an actual max address. Current s390 usage: memblock_enforce_memory_limit(memblock_end_of_DRAM()); yields different results depending on presence of memory holes (offline memory blocks in between online memory). If there are no memory holes limit == max_addr in memblock_enforce_memory_limit() and it does trim online memory and reserved memory regions. With memory holes present it actually does nothing. Since we already use memblock_remove() explicitly to trim online memory regions to potential limit (think mem=, kdump, addressing limits, etc.) drop the usage of memblock_enforce_memory_limit() altogether. Trimming reserved regions should not be required, since we now use memblock_set_current_limit() to limit allocations and any explicit memory reservations above the limit is an actual problem we should not hide. Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 420f48f commit 5dbc4cb

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

arch/s390/kernel/setup.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,6 @@ static void __init setup_memory(void)
818818
storage_key_init_range(start, end);
819819

820820
psw_set_key(PAGE_DEFAULT_KEY);
821-
822-
/* Only cosmetics */
823-
memblock_enforce_memory_limit(memblock_end_of_DRAM());
824821
}
825822

826823
static void __init relocate_amode31_section(void)

0 commit comments

Comments
 (0)