Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263824
b: refs/heads/master
c: a4d3e9e
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Weiner authored and Linus Torvalds committed Sep 15, 2011
1 parent 248242a commit 06f3d8c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4c32f355cec2647efb65e4b24e630bd2386f787
refs/heads/master: a4d3e9e76337059406fcf3ead288c0df22a790e9
27 changes: 12 additions & 15 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1808,23 +1808,15 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc,
u64 fraction[2], denominator;
enum lru_list l;
int noswap = 0;
int force_scan = 0;
bool force_scan = false;
unsigned long nr_force_scan[2];


anon = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_ANON) +
zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON);
file = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_FILE) +
zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE);

if (((anon + file) >> priority) < SWAP_CLUSTER_MAX) {
/* kswapd does zone balancing and need to scan this zone */
if (scanning_global_lru(sc) && current_is_kswapd())
force_scan = 1;
/* memcg may have small limit and need to avoid priority drop */
if (!scanning_global_lru(sc))
force_scan = 1;
}
/* kswapd does zone balancing and needs to scan this zone */
if (scanning_global_lru(sc) && current_is_kswapd())
force_scan = true;
/* memcg may have small limit and need to avoid priority drop */
if (!scanning_global_lru(sc))
force_scan = true;

/* If we have no swap space, do not bother scanning anon pages. */
if (!sc->may_swap || (nr_swap_pages <= 0)) {
Expand All @@ -1837,6 +1829,11 @@ static void get_scan_count(struct zone *zone, struct scan_control *sc,
goto out;
}

anon = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_ANON) +
zone_nr_lru_pages(zone, sc, LRU_INACTIVE_ANON);
file = zone_nr_lru_pages(zone, sc, LRU_ACTIVE_FILE) +
zone_nr_lru_pages(zone, sc, LRU_INACTIVE_FILE);

if (scanning_global_lru(sc)) {
free = zone_page_state(zone, NR_FREE_PAGES);
/* If we have very few page cache pages,
Expand Down

0 comments on commit 06f3d8c

Please sign in to comment.