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

Commit 31e0e7fe 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: only clear pgdat congested/dirty/writeback state when balanced"

parents 84a47e8c 62cd5886
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -3151,17 +3151,17 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx)
	if (!zone_watermark_ok_safe(zone, order, mark, classzone_idx))
		return false;

	/*
	 * If any eligible zone is balanced then the node is not considered
	 * to be congested or dirty
	 */
	clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags);
	clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags);
	clear_bit(PGDAT_WRITEBACK, &zone->zone_pgdat->flags);

	return true;
}

/* Clear pgdat state for congested, dirty or under writeback. */
static void clear_pgdat_congested(pg_data_t *pgdat)
{
	clear_bit(PGDAT_CONGESTED, &pgdat->flags);
	clear_bit(PGDAT_DIRTY, &pgdat->flags);
	clear_bit(PGDAT_WRITEBACK, &pgdat->flags);
}

/*
 * Prepare kswapd for sleeping. This verifies that there are no processes
 * waiting in throttle_direct_reclaim() and that watermarks have been met.
@@ -3198,9 +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))
		if (zone_balanced(zone, order, classzone_idx)) {
			clear_pgdat_congested(pgdat);
			return true;
		}
	}

	return false;
}