mm/sparse: rename pfn_present() to pfn_in_present_section()
authorPingfan Liu <kernelfans@gmail.com>
Thu, 2 Apr 2020 04:09:27 +0000 (21:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Apr 2020 16:35:30 +0000 (09:35 -0700)
After introducing mem sub section concept, pfn_present() loses its literal
meaning, and will not be necessary a truth on partial populated mem
section.

Since all of the callers use it to judge an absent section, it is better
to rename pfn_present() as pfn_in_present_section().

Signed-off-by: Pingfan Liu <kernelfans@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> [powerpc]
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Leonardo Bras <leonardo@linux.ibm.com>
Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Cc: Nathan Lynch <nathanl@linux.ibm.com>
Link: http://lkml.kernel.org/r/1581919110-29575-1-git-send-email-kernelfans@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/powerpc/platforms/pseries/hotplug-memory.c
drivers/base/node.c
include/linux/mmzone.h
mm/page_ext.c
mm/shuffle.c

index a4d40a3ceea3143cba8138a11cd8dc7904a5caa5..f3ed1baa6289c591d99674688046f91d62e66a01 100644 (file)
@@ -360,7 +360,7 @@ static bool lmb_is_removable(struct drmem_lmb *lmb)
 
        for (i = 0; i < scns_per_block; i++) {
                pfn = PFN_DOWN(phys_addr);
-               if (!pfn_present(pfn)) {
+               if (!pfn_in_present_section(pfn)) {
                        phys_addr += MIN_MEMORY_BLOCK_SIZE;
                        continue;
                }
index 98a31bafc8a266ace27bf9002eaf9b0186a6fa96..10d7e818e118d32e9ca37429b10805099c467add 100644 (file)
@@ -772,7 +772,7 @@ static int register_mem_sect_under_node(struct memory_block *mem_blk,
                 * memory block could have several absent sections from start.
                 * skip pfn range from absent section
                 */
-               if (!pfn_present(pfn)) {
+               if (!pfn_in_present_section(pfn)) {
                        pfn = round_down(pfn + PAGES_PER_SECTION,
                                         PAGES_PER_SECTION) - 1;
                        continue;
index 4bca42eeb4399d2ff05beb9cd06e2245bf7ccfa4..e84d448988b6594f67c042111953cc4a0991671d 100644 (file)
@@ -1374,7 +1374,7 @@ static inline int pfn_valid(unsigned long pfn)
 }
 #endif
 
-static inline int pfn_present(unsigned long pfn)
+static inline int pfn_in_present_section(unsigned long pfn)
 {
        if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
                return 0;
@@ -1411,7 +1411,7 @@ void sparse_init(void);
 #else
 #define sparse_init()  do {} while (0)
 #define sparse_index_init(_sec, _nid)  do {} while (0)
-#define pfn_present pfn_valid
+#define pfn_in_present_section pfn_valid
 #define subsection_map_init(_pfn, _nr_pages) do {} while (0)
 #endif /* CONFIG_SPARSEMEM */
 
index 4ade843ff58846cc9f73d3cb54ce78849643ca71..08ded037f89f655d0997214ec665c3ea4c48ae95 100644 (file)
@@ -304,7 +304,7 @@ static int __meminit online_page_ext(unsigned long start_pfn,
        }
 
        for (pfn = start; !fail && pfn < end; pfn += PAGES_PER_SECTION) {
-               if (!pfn_present(pfn))
+               if (!pfn_in_present_section(pfn))
                        continue;
                fail = init_section_page_ext(pfn, nid);
        }
index b3fe97fd665418adeb0b2d75419b5bd425db945e..c716059cbd3cca310c88597431ba44c4340362fd 100644 (file)
@@ -72,7 +72,7 @@ static struct page * __meminit shuffle_valid_page(unsigned long pfn, int order)
                return NULL;
 
        /* ...is the pfn in a present section or a hole? */
-       if (!pfn_present(pfn))
+       if (!pfn_in_present_section(pfn))
                return NULL;
 
        /* ...is the page free and currently on a free_area list? */