Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5267c5ec authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mm, vmscan: fix zone balance check in prepare_kswapd_sleep"

parents 258e8b27 eeb5a6a1
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -3198,11 +3198,11 @@ static bool prepare_kswapd_sleep(pg_data_t *pgdat, int order, int classzone_idx)
		if (!managed_zone(zone))
			continue;

		if (!zone_balanced(zone, order, classzone_idx))
			return false;
		if (zone_balanced(zone, order, classzone_idx))
			return true;
	}

	return true;
	return false;
}

/*
@@ -3399,7 +3399,13 @@ 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);

	/* Try to sleep for a short interval */
	/*
	 * Try to sleep for a short interval. Note that kcompactd will only be
	 * woken if it is possible to sleep for a short interval. This is
	 * deliberate on the assumption that if reclaim cannot keep an
	 * eligible zone balanced that it's also unlikely that compaction will
	 * succeed.
	 */
	if (prepare_kswapd_sleep(pgdat, reclaim_order, classzone_idx)) {
		/*
		 * Compaction records what page blocks it recently failed to