Merge "mm: wake kcompactd before kswapd's short sleep"
This commit is contained in:
commit
7e6c1371c9
1 changed files with 14 additions and 14 deletions
28
mm/vmscan.c
28
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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue