Commit 49945974 authored by Yuchen Tang's avatar Yuchen Tang
Browse files

mm: Export symbol reclaim_pages

euleros inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8T1MB?from=project-issue


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: default avatarYuchen Tang <tangyuchen5@huawei.com>
parent 5d3b64fd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -416,6 +416,7 @@ extern void lru_cache_add_inactive_or_unevictable(struct page *page,
extern unsigned long zone_reclaimable_pages(struct zone *zone);
extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
					gfp_t gfp_mask, nodemask_t *mask);
extern unsigned long reclaim_pages(struct list_head *folio_list);

#define MEMCG_RECLAIM_MAY_SWAP (1 << 1)
#define MEMCG_RECLAIM_PROACTIVE (1 << 2)
+0 −1
Original line number Diff line number Diff line
@@ -810,7 +810,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 */
+1 −0
Original line number Diff line number Diff line
@@ -2844,6 +2844,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)