Commit a21e2553 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Linus Torvalds

PM/Hibernate: Fix memory shrinking

Commit d979677c ("mm: shrink_all_memory(): use sc.nr_reclaimed")
broke the memory shrinking used by hibernation, becuse it did not update
shrink_all_zones() in accordance with the other changes it made.

Fix this by making shrink_all_zones() update sc->nr_reclaimed instead of
overwriting its value.

This fixes http://bugzilla.kernel.org/show_bug.cgi?id=13058Reported-and-tested-by: default avatarAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent aefe6475
......@@ -2088,13 +2088,13 @@ static void shrink_all_zones(unsigned long nr_pages, int prio,
nr_reclaimed += shrink_list(l, nr_to_scan, zone,
sc, prio);
if (nr_reclaimed >= nr_pages) {
sc->nr_reclaimed = nr_reclaimed;
sc->nr_reclaimed += nr_reclaimed;
return;
}
}
}
}
sc->nr_reclaimed = nr_reclaimed;
sc->nr_reclaimed += nr_reclaimed;
}
/*
......@@ -2115,6 +2115,7 @@ unsigned long shrink_all_memory(unsigned long nr_pages)
.may_unmap = 0,
.may_writepage = 1,
.isolate_pages = isolate_pages_global,
.nr_reclaimed = 0,
};
current->reclaim_state = &reclaim_state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment