Files
linux/arch/s390/kernel
Vasily Gorbik 5db28ea9f1 s390/setup: avoid using memblock_enforce_memory_limit
[ Upstream commit 5dbc4cb466 ]

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 <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-12-08 09:01:09 +01:00
..
2019-07-23 10:45:53 +02:00
2020-06-30 15:37:05 -04:00
2021-09-15 09:47:28 +02:00
2021-11-26 10:47:21 +01:00
2019-04-29 10:47:10 +02:00
2019-05-02 13:54:11 +02:00
2018-02-27 08:05:23 +01:00
2019-06-07 10:09:37 +02:00