git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vmscan: fix initial shrinker size handling
[pandora-kernel.git]
/
mm
/
vmscan.c
diff --git
a/mm/vmscan.c
b/mm/vmscan.c
index
132d1dd
..
f525544
100644
(file)
--- a/
mm/vmscan.c
+++ b/
mm/vmscan.c
@@
-247,14
+247,18
@@
unsigned long shrink_slab(struct shrink_control *shrink,
list_for_each_entry(shrinker, &shrinker_list, list) {
unsigned long long delta;
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;
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
/*
* copy the current shrinker scan count into a local variable
* and zero it so that other concurrent shrinker invocations
@@
-265,7
+269,6
@@
unsigned long shrink_slab(struct shrink_control *shrink,
} while (cmpxchg(&shrinker->nr, nr, 0) != nr);
total_scan = nr;
} 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);
delta = (4 * nr_pages_scanned) / shrinker->seeks;
delta *= max_pass;
do_div(delta, lru_pages + 1);
@@
-2266,7
+2269,8
@@
static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
*/
writeback_threshold = sc->nr_to_reclaim + sc->nr_to_reclaim / 2;
if (total_scanned > writeback_threshold) {
*/
writeback_threshold = sc->nr_to_reclaim + sc->nr_to_reclaim / 2;
if (total_scanned > writeback_threshold) {
- wakeup_flusher_threads(laptop_mode ? 0 : total_scanned);
+ wakeup_flusher_threads(laptop_mode ? 0 : total_scanned,
+ WB_REASON_TRY_TO_FREE_PAGES);
sc->may_writepage = 1;
}
sc->may_writepage = 1;
}