Merge "mm: wake kcompactd before kswapd's short sleep"

This commit is contained in:
Linux Build Service Account 2017-02-25 01:09:40 -08:00 committed by Gerrit - the friendly Code Review server
commit 7e6c1371c9

View file

@ -3415,6 +3415,20 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int order,
/* Try to sleep for a short interval */ /* Try to sleep for a short interval */
if (prepare_kswapd_sleep(pgdat, order, remaining, if (prepare_kswapd_sleep(pgdat, order, remaining,
balanced_classzone_idx)) { 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); remaining = schedule_timeout(HZ/10);
finish_wait(&pgdat->kswapd_wait, &wait); finish_wait(&pgdat->kswapd_wait, &wait);
prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE); 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); 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()) if (!kthread_should_stop())
schedule(); schedule();