Skip to content

Commit e03d1f7

Browse files
liupingfantorvalds
authored andcommitted
mm/sparse: rename pfn_present() to pfn_in_present_section()
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>
1 parent 4627d76 commit e03d1f7

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎arch/powerpc/platforms/pseries/hotplug-memory.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static bool lmb_is_removable(struct drmem_lmb *lmb)
360360

361361
for (i = 0; i < scns_per_block; i++) {
362362
pfn = PFN_DOWN(phys_addr);
363-
if (!pfn_present(pfn)) {
363+
if (!pfn_in_present_section(pfn)) {
364364
phys_addr += MIN_MEMORY_BLOCK_SIZE;
365365
continue;
366366
}

‎drivers/base/node.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ static int register_mem_sect_under_node(struct memory_block *mem_blk,
772772
* memory block could have several absent sections from start.
773773
* skip pfn range from absent section
774774
*/
775-
if (!pfn_present(pfn)) {
775+
if (!pfn_in_present_section(pfn)) {
776776
pfn = round_down(pfn + PAGES_PER_SECTION,
777777
PAGES_PER_SECTION) - 1;
778778
continue;

‎include/linux/mmzone.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ static inline int pfn_valid(unsigned long pfn)
13741374
}
13751375
#endif
13761376

1377-
static inline int pfn_present(unsigned long pfn)
1377+
static inline int pfn_in_present_section(unsigned long pfn)
13781378
{
13791379
if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
13801380
return 0;
@@ -1411,7 +1411,7 @@ void sparse_init(void);
14111411
#else
14121412
#define sparse_init() do {} while (0)
14131413
#define sparse_index_init(_sec, _nid) do {} while (0)
1414-
#define pfn_present pfn_valid
1414+
#define pfn_in_present_section pfn_valid
14151415
#define subsection_map_init(_pfn, _nr_pages) do {} while (0)
14161416
#endif /* CONFIG_SPARSEMEM */
14171417

‎mm/page_ext.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static int __meminit online_page_ext(unsigned long start_pfn,
304304
}
305305

306306
for (pfn = start; !fail && pfn < end; pfn += PAGES_PER_SECTION) {
307-
if (!pfn_present(pfn))
307+
if (!pfn_in_present_section(pfn))
308308
continue;
309309
fail = init_section_page_ext(pfn, nid);
310310
}

‎mm/shuffle.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static struct page * __meminit shuffle_valid_page(unsigned long pfn, int order)
7272
return NULL;
7373

7474
/* ...is the pfn in a present section or a hole? */
75-
if (!pfn_present(pfn))
75+
if (!pfn_in_present_section(pfn))
7676
return NULL;
7777

7878
/* ...is the page free and currently on a free_area list? */

0 commit comments

Comments
 (0)