|
@@ -3021,15 +3021,10 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx)
|
|
*
|
|
*
|
|
* Returns true if kswapd is ready to sleep
|
|
* Returns true if kswapd is ready to sleep
|
|
*/
|
|
*/
|
|
-static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, long remaining,
|
|
|
|
- int classzone_idx)
|
|
|
|
|
|
+static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, int classzone_idx)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- /* If a direct reclaimer woke kswapd within HZ/10, it's premature */
|
|
|
|
- if (remaining)
|
|
|
|
- return false;
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* The throttled processes are normally woken up in balance_pgdat() as
|
|
* The throttled processes are normally woken up in balance_pgdat() as
|
|
* soon as pfmemalloc_watermark_ok() is true. But there is a potential
|
|
* soon as pfmemalloc_watermark_ok() is true. But there is a potential
|
|
@@ -3244,7 +3239,7 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o
|
|
prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
|
|
prepare_to_wait(&pgdat->kswapd_wait, &wait, TASK_INTERRUPTIBLE);
|
|
|
|
|
|
/* Try to sleep for a short interval */
|
|
/* Try to sleep for a short interval */
|
|
- if (prepare_kswapd_sleep(pgdat, reclaim_order, remaining, classzone_idx)) {
|
|
|
|
|
|
+ if (prepare_kswapd_sleep(pgdat, reclaim_order, classzone_idx)) {
|
|
/*
|
|
/*
|
|
* Compaction records what page blocks it recently failed to
|
|
* Compaction records what page blocks it recently failed to
|
|
* isolate pages from and skips them in the future scanning.
|
|
* isolate pages from and skips them in the future scanning.
|
|
@@ -3279,7 +3274,8 @@ static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_o
|
|
* After a short sleep, check if it was a premature sleep. If not, then
|
|
* After a short sleep, check if it was a premature sleep. If not, then
|
|
* go fully to sleep until explicitly woken up.
|
|
* go fully to sleep until explicitly woken up.
|
|
*/
|
|
*/
|
|
- if (prepare_kswapd_sleep(pgdat, reclaim_order, remaining, classzone_idx)) {
|
|
|
|
|
|
+ if (!remaining &&
|
|
|
|
+ prepare_kswapd_sleep(pgdat, reclaim_order, classzone_idx)) {
|
|
trace_mm_vmscan_kswapd_sleep(pgdat->node_id);
|
|
trace_mm_vmscan_kswapd_sleep(pgdat->node_id);
|
|
|
|
|
|
/*
|
|
/*
|