]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
s390/setup: avoid using memblock_enforce_memory_limit
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 14 Oct 2021 11:38:17 +0000 (13:38 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 3 Feb 2022 17:57:18 +0000 (18:57 +0100)
commit7888748df21e653070640543f359b0e2767e8495
treeded1fada869d42a90c1d7ea8b225903ade709ac6
parentec02be4afbaa320cebf5b8d7cc95e4d9dc57072d
s390/setup: avoid using memblock_enforce_memory_limit

BugLink: https://bugs.launchpad.net/bugs/1956381
[ Upstream commit 5dbc4cb4667457b0c53bcd7bff11500b3c362975 ]

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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/s390/kernel/setup.c