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

Commit c81758fb authored by Minchan Kim's avatar Minchan Kim Committed by Linus Torvalds
Browse files

mm/compaction.c: fix deferring compaction mistake



Commit aff62249 ("vmscan: only defer compaction for failed order and
higher") fixed bad deferring policy but made mistake about checking
compact_order_failed in __compact_pgdat().  So it can't update
compact_order_failed with the new order.  This ends up preventing
correct operation of policy deferral.  This patch fixes it.

Signed-off-by: default avatarMinchan Kim <minchan@kernel.org>
Reviewed-by: default avatarRik van Riel <riel@redhat.com>
Acked-by: default avatarMel Gorman <mel@csn.ul.ie>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7838f994
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -861,7 +861,7 @@ static int __compact_pgdat(pg_data_t *pgdat, struct compact_control *cc)
		if (cc->order > 0) {
		if (cc->order > 0) {
			int ok = zone_watermark_ok(zone, cc->order,
			int ok = zone_watermark_ok(zone, cc->order,
						low_wmark_pages(zone), 0, 0);
						low_wmark_pages(zone), 0, 0);
			if (ok && cc->order > zone->compact_order_failed)
			if (ok && cc->order >= zone->compact_order_failed)
				zone->compact_order_failed = cc->order + 1;
				zone->compact_order_failed = cc->order + 1;
			/* Currently async compaction is never deferred. */
			/* Currently async compaction is never deferred. */
			else if (!ok && cc->sync)
			else if (!ok && cc->sync)