Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257362
b: refs/heads/master
c: 3567b59
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Al Viro committed Jul 20, 2011
1 parent b20771c commit c6f620c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: acf92b485cccf028177f46918e045c0c4e80ee10
refs/heads/master: 3567b59aa80ac4417002bf58e35dce5c777d4164
15 changes: 15 additions & 0 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,21 @@ unsigned long shrink_slab(struct shrink_control *shrink,
total_scan = max_pass;
}

/*
* We need to avoid excessive windup on filesystem shrinkers
* due to large numbers of GFP_NOFS allocations causing the
* shrinkers to return -1 all the time. This results in a large
* nr being built up so when a shrink that can do some work
* comes along it empties the entire cache due to nr >>>
* max_pass. This is bad for sustaining a working set in
* memory.
*
* Hence only allow the shrinker to scan the entire cache when
* a large delta change is calculated directly.
*/
if (delta < max_pass / 4)
total_scan = min(total_scan, max_pass / 2);

/*
* Avoid risking looping forever due to too large nr value:
* never try to free more than twice the estimate number of
Expand Down

0 comments on commit c6f620c

Please sign in to comment.