arm: extend pfn_valid to take into account freed memory map alignment
authorMike Rapoport <rppt@linux.ibm.com>
Mon, 13 Dec 2021 09:41:34 +0000 (17:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Dec 2021 09:14:42 +0000 (10:14 +0100)
commit65c578935bcc26ddc04e6757b2c7be95bf235b31
treeeca10fa144b4701c24b6dd985bf909564274157c
parent6e634c0e7155141c307958a600720bc418137554
arm: extend pfn_valid to take into account freed memory map alignment

[ Upstream commit a4d5613c4dc6d413e0733e37db9d116a2a36b9f3 ]

When unused memory map is freed the preserved part of the memory map is
extended to match pageblock boundaries because lots of core mm
functionality relies on homogeneity of the memory map within pageblock
boundaries.

Since pfn_valid() is used to check whether there is a valid memory map
entry for a PFN, make it return true also for PFNs that have memory map
entries even if there is no actual memory populated there.

Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/lkml/20210630071211.21011-1-rppt@kernel.org/
Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mm/init.c