arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
commit 5e545df3292fbd3d5963c68980f1527ead2a2b3f upstream.
ARM is the only architecture that defines CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
which in turn enables memmap_valid_within() function that is intended to
verify existence of struct page associated with a pfn when there are holes
in the memory map.
However, the ARCH_HAS_HOLES_MEMORYMODEL also enables HAVE_ARCH_PFN_VALID
and arch-specific pfn_valid() implementation that also deals with the holes
in the memory map.
The only two users of memmap_valid_within() call this function after
a call to pfn_valid() so the memmap_valid_within() check becomes redundant.
Remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL and memmap_valid_within() and rely
entirely on ARM's implementation of pfn_valid() that is now enabled
unconditionally.
Link: https://lkml.kernel.org/r/20201101170454.9567-9-rppt@kernel.org
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Greg Ungerer <gerg@linux-m68k.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Meelis Roos <mroos@linux.ee>
Cc: Michael Schmitz <schmitzmic@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 8dd559d53b
("arm: ioremap: don't abuse pfn_valid() to check if pfn is in RAM")
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
dfb55dcf9d
commit
9ff4a6b806
@@ -1443,37 +1443,6 @@ struct mminit_pfnnid_cache {
|
||||
#define pfn_valid_within(pfn) (1)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
|
||||
/*
|
||||
* pfn_valid() is meant to be able to tell if a given PFN has valid memmap
|
||||
* associated with it or not. This means that a struct page exists for this
|
||||
* pfn. The caller cannot assume the page is fully initialized in general.
|
||||
* Hotplugable pages might not have been onlined yet. pfn_to_online_page()
|
||||
* will ensure the struct page is fully online and initialized. Special pages
|
||||
* (e.g. ZONE_DEVICE) are never onlined and should be treated accordingly.
|
||||
*
|
||||
* In FLATMEM, it is expected that holes always have valid memmap as long as
|
||||
* there is valid PFNs either side of the hole. In SPARSEMEM, it is assumed
|
||||
* that a valid section has a memmap for the entire section.
|
||||
*
|
||||
* However, an ARM, and maybe other embedded architectures in the future
|
||||
* free memmap backing holes to save memory on the assumption the memmap is
|
||||
* never used. The page_zone linkages are then broken even though pfn_valid()
|
||||
* returns true. A walker of the full memmap must then do this additional
|
||||
* check to ensure the memmap they are looking at is sane by making sure
|
||||
* the zone and PFN linkages are still valid. This is expensive, but walkers
|
||||
* of the full memmap are extremely rare.
|
||||
*/
|
||||
bool memmap_valid_within(unsigned long pfn,
|
||||
struct page *page, struct zone *zone);
|
||||
#else
|
||||
static inline bool memmap_valid_within(unsigned long pfn,
|
||||
struct page *page, struct zone *zone)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */
|
||||
|
||||
#endif /* !__GENERATING_BOUNDS.H */
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
#endif /* _LINUX_MMZONE_H */
|
||||
|
Reference in New Issue
Block a user