Commit a9e7c39f authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Linus Torvalds

mm/vmscan.c: remove 7th argument of isolate_lru_pages()

We may simply check for sc->may_unmap in isolate_lru_pages() instead of
doing that in both of its callers.

Link: http://lkml.kernel.org/r/154748280735.29962.15867846875217618569.stgit@localhost.localdomainSigned-off-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e25644e
...@@ -1653,7 +1653,7 @@ static __always_inline void update_lru_sizes(struct lruvec *lruvec, ...@@ -1653,7 +1653,7 @@ static __always_inline void update_lru_sizes(struct lruvec *lruvec,
static unsigned long isolate_lru_pages(unsigned long nr_to_scan, static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
struct lruvec *lruvec, struct list_head *dst, struct lruvec *lruvec, struct list_head *dst,
unsigned long *nr_scanned, struct scan_control *sc, unsigned long *nr_scanned, struct scan_control *sc,
isolate_mode_t mode, enum lru_list lru) enum lru_list lru)
{ {
struct list_head *src = &lruvec->lists[lru]; struct list_head *src = &lruvec->lists[lru];
unsigned long nr_taken = 0; unsigned long nr_taken = 0;
...@@ -1662,6 +1662,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, ...@@ -1662,6 +1662,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
unsigned long skipped = 0; unsigned long skipped = 0;
unsigned long scan, total_scan, nr_pages; unsigned long scan, total_scan, nr_pages;
LIST_HEAD(pages_skipped); LIST_HEAD(pages_skipped);
isolate_mode_t mode = (sc->may_unmap ? 0 : ISOLATE_UNMAPPED);
scan = 0; scan = 0;
for (total_scan = 0; for (total_scan = 0;
...@@ -1900,7 +1901,6 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, ...@@ -1900,7 +1901,6 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
unsigned long nr_reclaimed = 0; unsigned long nr_reclaimed = 0;
unsigned long nr_taken; unsigned long nr_taken;
struct reclaim_stat stat = {}; struct reclaim_stat stat = {};
isolate_mode_t isolate_mode = 0;
int file = is_file_lru(lru); int file = is_file_lru(lru);
struct pglist_data *pgdat = lruvec_pgdat(lruvec); struct pglist_data *pgdat = lruvec_pgdat(lruvec);
struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat; struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
...@@ -1921,13 +1921,10 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, ...@@ -1921,13 +1921,10 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec,
lru_add_drain(); lru_add_drain();
if (!sc->may_unmap)
isolate_mode |= ISOLATE_UNMAPPED;
spin_lock_irq(&pgdat->lru_lock); spin_lock_irq(&pgdat->lru_lock);
nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &page_list, nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &page_list,
&nr_scanned, sc, isolate_mode, lru); &nr_scanned, sc, lru);
__mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken); __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken);
reclaim_stat->recent_scanned[file] += nr_taken; reclaim_stat->recent_scanned[file] += nr_taken;
...@@ -2084,19 +2081,15 @@ static void shrink_active_list(unsigned long nr_to_scan, ...@@ -2084,19 +2081,15 @@ static void shrink_active_list(unsigned long nr_to_scan,
struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat; struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat;
unsigned nr_deactivate, nr_activate; unsigned nr_deactivate, nr_activate;
unsigned nr_rotated = 0; unsigned nr_rotated = 0;
isolate_mode_t isolate_mode = 0;
int file = is_file_lru(lru); int file = is_file_lru(lru);
struct pglist_data *pgdat = lruvec_pgdat(lruvec); struct pglist_data *pgdat = lruvec_pgdat(lruvec);
lru_add_drain(); lru_add_drain();
if (!sc->may_unmap)
isolate_mode |= ISOLATE_UNMAPPED;
spin_lock_irq(&pgdat->lru_lock); spin_lock_irq(&pgdat->lru_lock);
nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold, nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold,
&nr_scanned, sc, isolate_mode, lru); &nr_scanned, sc, lru);
__mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken); __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken);
reclaim_stat->recent_scanned[file] += nr_taken; reclaim_stat->recent_scanned[file] += nr_taken;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment