diff options
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index b934223eaa45..142cb61f4822 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2553,7 +2553,7 @@ static bool shrink_zones(struct zonelist *zonelist, struct scan_control *sc) | |||
2553 | sc->gfp_mask |= __GFP_HIGHMEM; | 2553 | sc->gfp_mask |= __GFP_HIGHMEM; |
2554 | 2554 | ||
2555 | for_each_zone_zonelist_nodemask(zone, z, zonelist, | 2555 | for_each_zone_zonelist_nodemask(zone, z, zonelist, |
2556 | requested_highidx, sc->nodemask) { | 2556 | gfp_zone(sc->gfp_mask), sc->nodemask) { |
2557 | enum zone_type classzone_idx; | 2557 | enum zone_type classzone_idx; |
2558 | 2558 | ||
2559 | if (!populated_zone(zone)) | 2559 | if (!populated_zone(zone)) |
@@ -3318,6 +3318,20 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, | |||
3318 | /* Try to sleep for a short interval */ | 3318 | /* Try to sleep for a short interval */ |
3319 | if (prepare_kswapd_sleep(pgdat, order, remaining, | 3319 | if (prepare_kswapd_sleep(pgdat, order, remaining, |
3320 | balanced_classzone_idx)) { | 3320 | balanced_classzone_idx)) { |
3321 | /* | ||
3322 | * Compaction records what page blocks it recently failed to | ||
3323 | * isolate pages from and skips them in the future scanning. | ||
3324 | * When kswapd is going to sleep, it is reasonable to assume | ||
3325 | * that pages and compaction may succeed so reset the cache. | ||
3326 | */ | ||
3327 | reset_isolation_suitable(pgdat); | ||
3328 | |||
3329 | /* | ||
3330 | * We have freed the memory, now we should compact it to make | ||
3331 | * allocation of the requested order possible. | ||
3332 | */ | ||
3333 | wakeup_kcompactd(pgdat, order, classzone_idx); | ||
3334 | |||
3321 | remaining = schedule_timeout(HZ/10); | 3335 | remaining = schedule_timeout(HZ/10); |
3322 | finish_wait(&pgdat->kswapd_wait, &wait); | 3336 | finish_wait(&pgdat->kswapd_wait, &wait); |
3323 | prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE); | 3337 | prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE); |
@@ -3341,20 +3355,6 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, | |||
3341 | */ | 3355 | */ |
3342 | set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold); | 3356 | set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold); |
3343 | 3357 | ||
3344 | /* | ||
3345 | * Compaction records what page blocks it recently failed to | ||
3346 | * isolate pages from and skips them in the future scanning. | ||
3347 | * When kswapd is going to sleep, it is reasonable to assume | ||
3348 | * that pages and compaction may succeed so reset the cache. | ||
3349 | */ | ||
3350 | reset_isolation_suitable(pgdat); | ||
3351 | |||
3352 | /* | ||
3353 | * We have freed the memory, now we should compact it to make | ||
3354 | * allocation of the requested order possible. | ||
3355 | */ | ||
3356 | wakeup_kcompactd(pgdat, order, classzone_idx); | ||
3357 | |||
3358 | if (!kthread_should_stop()) | 3358 | if (!kthread_should_stop()) |
3359 | schedule(); | 3359 | schedule(); |
3360 | 3360 | ||