diff options
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-.patch | 53 |
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 @@ | |||
1 | From 6a918e81eb228757f20a244ee0d81c32ba7feedc Mon Sep 17 00:00:00 2001 | ||
2 | From: David Rientjes <rientjes@google.com> | ||
3 | Date: Wed, 11 Jul 2012 14:02:13 -0700 | ||
4 | Subject: [PATCH 040/109] mm, thp: abort compaction if migration page cannot | ||
5 | be charged to memcg | ||
6 | |||
7 | commit 4bf2bba3750f10aa9e62e6949bc7e8329990f01b upstream. | ||
8 | |||
9 | If page migration cannot charge the temporary page to the memcg, | ||
10 | migrate_pages() will return -ENOMEM. This isn't considered in memory | ||
11 | compaction however, and the loop continues to iterate over all | ||
12 | pageblocks trying to isolate and migrate pages. If a small number of | ||
13 | very large memcgs happen to be oom, however, these attempts will mostly | ||
14 | be futile leading to an enormous amout of cpu consumption due to the | ||
15 | page migration failures. | ||
16 | |||
17 | This patch will short circuit and fail memory compaction if | ||
18 | migrate_pages() returns -ENOMEM. COMPACT_PARTIAL is returned in case | ||
19 | some migrations were successful so that the page allocator will retry. | ||
20 | |||
21 | Signed-off-by: David Rientjes <rientjes@google.com> | ||
22 | Acked-by: Mel Gorman <mgorman@suse.de> | ||
23 | Cc: Minchan Kim <minchan@kernel.org> | ||
24 | Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | ||
25 | Cc: Rik van Riel <riel@redhat.com> | ||
26 | Cc: Andrea Arcangeli <aarcange@redhat.com> | ||
27 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | ||
28 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
29 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
30 | --- | ||
31 | mm/compaction.c | 5 ++++- | ||
32 | 1 files changed, 4 insertions(+), 1 deletions(-) | ||
33 | |||
34 | diff --git a/mm/compaction.c b/mm/compaction.c | ||
35 | index 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 | -- | ||
52 | 1.7.7.6 | ||
53 | |||