euleros inclusion category: feature bugzilla: NA CVE: NA
-------------------------------------------------
Export reclaim_pages so that etmem_swap can exploit this for memory reclamation.
In etmem swap module, it will receive a list of pages that need to be reclaimed, sent from the user mode program. etmem swap module will do some checks and add appropriate candidates to folio_list, which will later be reclaimed by reclaim_pages
Signed-off-by: Yuchen Tang tangyuchen5@huawei.com --- include/linux/swap.h | 2 +- mm/internal.h | 1 - mm/vmscan.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/swap.h b/include/linux/swap.h index fe20c462fecb..3071d97d0424 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h @@ -698,6 +698,6 @@ static inline bool mem_cgroup_swap_full(struct folio *folio) return vm_swap_full(); } #endif - +extern unsigned long reclaim_pages(struct list_head *folio_list); #endif /* __KERNEL__*/ #endif /* _LINUX_SWAP_H */ diff --git a/mm/internal.h b/mm/internal.h index 1ebba69437d6..4d9379c03cdf 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -804,7 +804,6 @@ extern unsigned long __must_check vm_mmap_pgoff(struct file *, unsigned long, unsigned long, unsigned long);
extern void set_pageblock_order(void); -unsigned long reclaim_pages(struct list_head *folio_list); unsigned int reclaim_clean_pages_from_list(struct zone *zone, struct list_head *folio_list); /* The ALLOC_WMARK bits are used as an index to zone->watermark */ diff --git a/mm/vmscan.c b/mm/vmscan.c index 7a676296af30..f42c9dcfa016 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2840,6 +2840,7 @@ unsigned long reclaim_pages(struct list_head *folio_list)
return nr_reclaimed; } +EXPORT_SYMBOL_GPL(reclaim_pages);
static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan, struct lruvec *lruvec, struct scan_control *sc)