summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch
new file mode 100644
index 00000000..74ca9bf6
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.24/0040-mm-thp-abort-compaction-if-migration-page-cannot-be-.patch
@@ -0,0 +1,53 @@
1From 6a918e81eb228757f20a244ee0d81c32ba7feedc Mon Sep 17 00:00:00 2001
2From: David Rientjes <rientjes@google.com>
3Date: Wed, 11 Jul 2012 14:02:13 -0700
4Subject: [PATCH 040/109] mm, thp: abort compaction if migration page cannot
5 be charged to memcg
6
7commit 4bf2bba3750f10aa9e62e6949bc7e8329990f01b upstream.
8
9If page migration cannot charge the temporary page to the memcg,
10migrate_pages() will return -ENOMEM. This isn't considered in memory
11compaction however, and the loop continues to iterate over all
12pageblocks trying to isolate and migrate pages. If a small number of
13very large memcgs happen to be oom, however, these attempts will mostly
14be futile leading to an enormous amout of cpu consumption due to the
15page migration failures.
16
17This patch will short circuit and fail memory compaction if
18migrate_pages() returns -ENOMEM. COMPACT_PARTIAL is returned in case
19some migrations were successful so that the page allocator will retry.
20
21Signed-off-by: David Rientjes <rientjes@google.com>
22Acked-by: Mel Gorman <mgorman@suse.de>
23Cc: Minchan Kim <minchan@kernel.org>
24Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
25Cc: Rik van Riel <riel@redhat.com>
26Cc: Andrea Arcangeli <aarcange@redhat.com>
27Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
28Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
29Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
30---
31 mm/compaction.c | 5 ++++-
32 1 files changed, 4 insertions(+), 1 deletions(-)
33
34diff --git a/mm/compaction.c b/mm/compaction.c
35index 8fb8a40..50f1c60 100644
36--- a/mm/compaction.c
37+++ b/mm/compaction.c
38@@ -592,8 +592,11 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
39 if (err) {
40 putback_lru_pages(&cc->migratepages);
41 cc->nr_migratepages = 0;
42+ if (err == -ENOMEM) {
43+ ret = COMPACT_PARTIAL;
44+ goto out;
45+ }
46 }
47-
48 }
49
50 out:
51--
521.7.7.6
53