mm: rename reclaim_pages() to reclaim_folios()
Commit Message
As commit a83f0551f496 ("mm/vmscan: convert reclaim_pages() to use
a folio") changes the arg from page_list to folio_list, but not
the defination, let's correct it and rename it to reclaim_folios too.
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
include/linux/swap.h | 2 +-
mm/damon/paddr.c | 2 +-
mm/madvise.c | 4 ++--
mm/shmem.c | 4 ++--
mm/vmscan.c | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
Comments
On Sat, Apr 15, 2023 at 05:27:16PM +0800, Kefeng Wang wrote:
> As commit a83f0551f496 ("mm/vmscan: convert reclaim_pages() to use
> a folio") changes the arg from page_list to folio_list, but not
> the defination, let's correct it and rename it to reclaim_folios too.
I didn't bother. It's not inaccurate; we're reclaiming the pages
in the folios.
On 2023/4/16 0:04, Matthew Wilcox wrote:
> On Sat, Apr 15, 2023 at 05:27:16PM +0800, Kefeng Wang wrote:
>> As commit a83f0551f496 ("mm/vmscan: convert reclaim_pages() to use
>> a folio") changes the arg from page_list to folio_list, but not
>> the defination, let's correct it and rename it to reclaim_folios too.
>
> I didn't bother. It's not inaccurate; we're reclaiming the pages
> in the folios.
OK, keep the name seems better, there is another similar issue in
reclaim_clean_pages_from_list(), I will only unify the arg between
definition and declaration.>
Matthew Wilcox <willy@infradead.org> writes:
> On Sat, Apr 15, 2023 at 05:27:16PM +0800, Kefeng Wang wrote:
>> As commit a83f0551f496 ("mm/vmscan: convert reclaim_pages() to use
>> a folio") changes the arg from page_list to folio_list, but not
>> the defination, let's correct it and rename it to reclaim_folios too.
>
> I didn't bother. It's not inaccurate; we're reclaiming the pages
> in the folios.
What's the general rule about renaming "pages" to "folios" in function
names? I am thinking whether it's necessary to rename migrate_pages()
to migrate_folios(). It's unnecessary?
Best Regards,
Huang, Ying
@@ -442,7 +442,7 @@ extern unsigned long shrink_all_memory(unsigned long nr_pages);
extern int vm_swappiness;
long remove_mapping(struct address_space *mapping, struct folio *folio);
-extern unsigned long reclaim_pages(struct list_head *page_list);
+unsigned long reclaim_folios(struct list_head *folio_list);
#ifdef CONFIG_NUMA
extern int node_reclaim_mode;
extern int sysctl_min_unmapped_ratio;
@@ -255,7 +255,7 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s)
list_add(&folio->lru, &folio_list);
folio_put(folio);
}
- applied = reclaim_pages(&folio_list);
+ applied = reclaim_folios(&folio_list);
cond_resched();
return applied * PAGE_SIZE;
}
@@ -417,7 +417,7 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
huge_unlock:
spin_unlock(ptl);
if (pageout)
- reclaim_pages(&folio_list);
+ reclaim_folios(&folio_list);
return 0;
}
@@ -513,7 +513,7 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
arch_leave_lazy_mmu_mode();
pte_unmap_unlock(orig_pte, ptl);
if (pageout)
- reclaim_pages(&folio_list);
+ reclaim_folios(&folio_list);
cond_resched();
return 0;
@@ -2381,7 +2381,7 @@ static void shmem_isolate_pages_range(struct address_space *mapping, loff_t star
folio_put(folio);
/*
- * Prepare the folios to be passed to reclaim_pages().
+ * Prepare the folios to be passed to reclaim_folios().
* VM can't reclaim a folio unless young bit is
* cleared in its flags.
*/
@@ -2406,7 +2406,7 @@ static int shmem_fadvise_dontneed(struct address_space *mapping, loff_t start,
lru_add_drain();
shmem_isolate_pages_range(mapping, start, end, &folio_list);
- reclaim_pages(&folio_list);
+ reclaim_folios(&folio_list);
return 0;
}
@@ -2786,7 +2786,7 @@ static unsigned int reclaim_folio_list(struct list_head *folio_list,
return nr_reclaimed;
}
-unsigned long reclaim_pages(struct list_head *folio_list)
+unsigned long reclaim_folios(struct list_head *folio_list)
{
int nid;
unsigned int nr_reclaimed = 0;