Skip to content

Commit

Permalink
Revert "memcg, vmscan: Fix forced scan of anonymous pages"
Browse files Browse the repository at this point in the history
This reverts commit 7b2936c23f3078567292416798da68c99d0c87b0.
  • Loading branch information
Dorimanx authored and gj86 committed Nov 27, 2017
1 parent dcc9760 commit 6506720
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
struct zone *zone = lruvec_zone(lruvec);
unsigned long anon_prio, file_prio;
enum scan_balance scan_balance;
unsigned long anon, file;
unsigned long anon, file, free;
bool force_scan = false;
unsigned long ap, fp;
enum lru_list lru;
Expand Down Expand Up @@ -2045,21 +2045,20 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
goto out;
}

anon = get_lru_size(lruvec, LRU_ACTIVE_ANON) +
get_lru_size(lruvec, LRU_INACTIVE_ANON);
file = get_lru_size(lruvec, LRU_ACTIVE_FILE) +
get_lru_size(lruvec, LRU_INACTIVE_FILE);

/*
* If it's foreseeable that reclaiming the file cache won't be
* enough to get the zone back into a desirable shape, we have
* to swap. Better start now and leave the - probably heavily
* thrashing - remaining file pages alone.
*/
if (global_reclaim(sc)) {
unsigned long zonefile;
unsigned long zonefree;

zonefree = zone_page_state(zone, NR_FREE_PAGES);
zonefile = zone_page_state(zone, NR_ACTIVE_FILE) +
zone_page_state(zone, NR_INACTIVE_FILE);

if (unlikely(zonefile + zonefree <= high_wmark_pages(zone))) {
free = zone_page_state(zone, NR_FREE_PAGES);
if (unlikely(file + free <= high_wmark_pages(zone))) {
scan_balance = SCAN_ANON;
goto out;
}
Expand Down Expand Up @@ -2099,12 +2098,6 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
*
* anon in [0], file in [1]
*/

anon = get_lru_size(lruvec, LRU_ACTIVE_ANON) +
get_lru_size(lruvec, LRU_INACTIVE_ANON);
file = get_lru_size(lruvec, LRU_ACTIVE_FILE) +
get_lru_size(lruvec, LRU_INACTIVE_FILE);

spin_lock_irq(&zone->lru_lock);
if (unlikely(reclaim_stat->recent_scanned[0] > anon / 4)) {
reclaim_stat->recent_scanned[0] /= 2;
Expand Down

0 comments on commit 6506720

Please sign in to comment.