aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/vmscan.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 66698f603aa4..d303b60f4c2a 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -231,8 +231,11 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
231 if (scanned == 0) 231 if (scanned == 0)
232 scanned = SWAP_CLUSTER_MAX; 232 scanned = SWAP_CLUSTER_MAX;
233 233
234 if (!down_read_trylock(&shrinker_rwsem)) 234 if (!down_read_trylock(&shrinker_rwsem)) {
235 return 1; /* Assume we'll be able to shrink next time */ 235 /* Assume we'll be able to shrink next time */
236 ret = 1;
237 goto out;
238 }
236 239
237 list_for_each_entry(shrinker, &shrinker_list, list) { 240 list_for_each_entry(shrinker, &shrinker_list, list) {
238 unsigned long long delta; 241 unsigned long long delta;
@@ -283,6 +286,8 @@ unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
283 shrinker->nr += total_scan; 286 shrinker->nr += total_scan;
284 } 287 }
285 up_read(&shrinker_rwsem); 288 up_read(&shrinker_rwsem);
289out:
290 cond_resched();
286 return ret; 291 return ret;
287} 292}
288 293