diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-25 01:09:40 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-02-25 01:09:40 -0800 |
| commit | 7e6c1371c99f9d744fce4a094e94abeb9bb9c018 (patch) | |
| tree | 186a2613db541cf53c4bc55604432fe9bbea48ae | |
| parent | fedfb30bbd667643fe32d0c07b478849f0c846c0 (diff) | |
| parent | 938059708227021207e5a245ca947c53bea6bd1e (diff) | |
Merge "mm: wake kcompactd before kswapd's short sleep"
| -rw-r--r-- | mm/vmscan.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 2baffcb9a53f..31b3528d5169 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3415,6 +3415,20 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, /* Try to sleep for a short interval */ if (prepare_kswapd_sleep(pgdat, order, remaining, balanced_classzone_idx)) { + /* + * Compaction records what page blocks it recently failed to + * isolate pages from and skips them in the future scanning. + * When kswapd is going to sleep, it is reasonable to assume + * that pages and compaction may succeed so reset the cache. + */ + reset_isolation_suitable(pgdat); + + /* + * We have freed the memory, now we should compact it to make + * allocation of the requested order possible. + */ + wakeup_kcompactd(pgdat, order, classzone_idx); + remaining = schedule_timeout(HZ/10); finish_wait(&pgdat->kswapd_wait, &wait); prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE); @@ -3438,20 +3452,6 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order, */ set_pgdat_percpu_threshold(pgdat, calculate_normal_threshold); - /* - * Compaction records what page blocks it recently failed to - * isolate pages from and skips them in the future scanning. - * When kswapd is going to sleep, it is reasonable to assume - * that pages and compaction may succeed so reset the cache. - */ - reset_isolation_suitable(pgdat); - - /* - * We have freed the memory, now we should compact it to make - * allocation of the requested order possible. - */ - wakeup_kcompactd(pgdat, order, classzone_idx); - if (!kthread_should_stop()) schedule(); |
