summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch119
1 files changed, 119 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch
new file mode 100644
index 00000000..76a434de
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0009-mm-vmscan-check-if-reclaim-should-really-abort-even-.patch
@@ -0,0 +1,119 @@
1From 0f7e2171b241704ee17ab27e4b8a7ef8c7f1dc32 Mon Sep 17 00:00:00 2001
2From: Mel Gorman <mgorman@suse.de>
3Date: Thu, 12 Jan 2012 17:19:49 -0800
4Subject: [PATCH 09/73] mm: vmscan: check if reclaim should really abort even
5 if compaction_ready() is true for one zone
6
7commit 0cee34fd72c582b4f8ad8ce00645b75fb4168199 upstream.
8
9Stable note: Not tracked on Bugzilla. THP and compaction was found to
10 aggressively reclaim pages and stall systems under different
11 situations that was addressed piecemeal over time.
12
13If compaction can proceed for a given zone, shrink_zones() does not
14reclaim any more pages from it. After commit [e0c2327: vmscan: abort
15reclaim/compaction if compaction can proceed], do_try_to_free_pages()
16tries to finish as soon as possible once one zone can compact.
17
18This was intended to prevent slabs being shrunk unnecessarily but there
19are side-effects. One is that a small zone that is ready for compaction
20will abort reclaim even if the chances of successfully allocating a THP
21from that zone is small. It also means that reclaim can return too early
22even though sc->nr_to_reclaim pages were not reclaimed.
23
24This partially reverts the commit until it is proven that slabs are really
25being shrunk unnecessarily but preserves the check to return 1 to avoid
26OOM if reclaim was aborted prematurely.
27
28[aarcange@redhat.com: This patch replaces a revert from Andrea]
29Signed-off-by: Mel Gorman <mgorman@suse.de>
30Reviewed-by: Rik van Riel <riel@redhat.com>
31Cc: Andrea Arcangeli <aarcange@redhat.com>
32Cc: Minchan Kim <minchan.kim@gmail.com>
33Cc: Dave Jones <davej@redhat.com>
34Cc: Jan Kara <jack@suse.cz>
35Cc: Andy Isaacson <adi@hexapodia.org>
36Cc: Nai Xia <nai.xia@gmail.com>
37Cc: Johannes Weiner <jweiner@redhat.com>
38Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
39Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
40Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
41---
42 mm/vmscan.c | 19 +++++++++----------
43 1 files changed, 9 insertions(+), 10 deletions(-)
44
45diff --git a/mm/vmscan.c b/mm/vmscan.c
46index 662a5ea..9e89de6 100644
47--- a/mm/vmscan.c
48+++ b/mm/vmscan.c
49@@ -2173,7 +2173,8 @@ static inline bool compaction_ready(struct zone *zone, struct scan_control *sc)
50 *
51 * This function returns true if a zone is being reclaimed for a costly
52 * high-order allocation and compaction is ready to begin. This indicates to
53- * the caller that it should retry the allocation or fail.
54+ * the caller that it should consider retrying the allocation instead of
55+ * further reclaim.
56 */
57 static bool shrink_zones(int priority, struct zonelist *zonelist,
58 struct scan_control *sc)
59@@ -2182,7 +2183,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist,
60 struct zone *zone;
61 unsigned long nr_soft_reclaimed;
62 unsigned long nr_soft_scanned;
63- bool should_abort_reclaim = false;
64+ bool aborted_reclaim = false;
65
66 for_each_zone_zonelist_nodemask(zone, z, zonelist,
67 gfp_zone(sc->gfp_mask), sc->nodemask) {
68@@ -2208,7 +2209,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist,
69 * allocations.
70 */
71 if (compaction_ready(zone, sc)) {
72- should_abort_reclaim = true;
73+ aborted_reclaim = true;
74 continue;
75 }
76 }
77@@ -2230,7 +2231,7 @@ static bool shrink_zones(int priority, struct zonelist *zonelist,
78 shrink_zone(priority, zone, sc);
79 }
80
81- return should_abort_reclaim;
82+ return aborted_reclaim;
83 }
84
85 static bool zone_reclaimable(struct zone *zone)
86@@ -2284,7 +2285,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
87 struct zoneref *z;
88 struct zone *zone;
89 unsigned long writeback_threshold;
90- bool should_abort_reclaim;
91+ bool aborted_reclaim;
92
93 get_mems_allowed();
94 delayacct_freepages_start();
95@@ -2296,9 +2297,7 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
96 sc->nr_scanned = 0;
97 if (!priority)
98 disable_swap_token(sc->mem_cgroup);
99- should_abort_reclaim = shrink_zones(priority, zonelist, sc);
100- if (should_abort_reclaim)
101- break;
102+ aborted_reclaim = shrink_zones(priority, zonelist, sc);
103
104 /*
105 * Don't shrink slabs when reclaiming memory from
106@@ -2365,8 +2364,8 @@ out:
107 if (oom_killer_disabled)
108 return 0;
109
110- /* Aborting reclaim to try compaction? don't OOM, then */
111- if (should_abort_reclaim)
112+ /* Aborted reclaim to try compaction? don't OOM, then */
113+ if (aborted_reclaim)
114 return 1;
115
116 /* top priority shrink_zones still had more to do? don't OOM, then */
117--
1181.7.7.6
119