Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276532
b: refs/heads/master
c: 635697c
h: refs/heads/master
v: v3
  • Loading branch information
Konstantin Khlebnikov authored and Linus Torvalds committed Dec 9, 2011
1 parent 8c3c064 commit 8ac255c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 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: 09d9673d53005fdf40de4c759425893904292236
refs/heads/master: 635697c663f38106063d5659f0cf2e45afcd4bb5
9 changes: 6 additions & 3 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,18 @@ unsigned long shrink_slab(struct shrink_control *shrink,

list_for_each_entry(shrinker, &shrinker_list, list) {
unsigned long long delta;
unsigned long total_scan;
unsigned long max_pass;
long total_scan;
long max_pass;
int shrink_ret = 0;
long nr;
long new_nr;
long batch_size = shrinker->batch ? shrinker->batch
: SHRINK_BATCH;

max_pass = do_shrinker_shrink(shrinker, shrink, 0);
if (max_pass <= 0)
continue;

/*
* copy the current shrinker scan count into a local variable
* and zero it so that other concurrent shrinker invocations
Expand All @@ -265,7 +269,6 @@ unsigned long shrink_slab(struct shrink_control *shrink,
} while (cmpxchg(&shrinker->nr, nr, 0) != nr);

total_scan = nr;
max_pass = do_shrinker_shrink(shrinker, shrink, 0);
delta = (4 * nr_pages_scanned) / shrinker->seeks;
delta *= max_pass;
do_div(delta, lru_pages + 1);
Expand Down

0 comments on commit 8ac255c

Please sign in to comment.