aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2012-11-29 16:54:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-11-30 11:51:17 -0500
commita50915394f1fc02c2861d3b7ce7014788aa5066e (patch)
tree4b94679a29fb97db6b5163a4c1345d62dfa6a1e7
parent60cefed485a02bd99b6299dad70666fe49245da7 (diff)
revert "Revert "mm: remove __GFP_NO_KSWAPD""
It apepars that this patch was innocent, and we hope that "mm: avoid waking kswapd for THP allocations when compaction is deferred or contended" will fix the final kswapd-spinning cause. Cc: Zdenek Kabelac <zkabelac@redhat.com> Cc: Seth Jennings <sjenning@linux.vnet.ibm.com> Cc: Valdis Kletnieks <Valdis.Kletnieks@vt.edu> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Rik van Riel <riel@redhat.com> Cc: Robert Jennings <rcj@linux.vnet.ibm.com> Cc: Mel Gorman <mgorman@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/mtd/mtdcore.c6
-rw-r--r--include/linux/gfp.h13
-rw-r--r--include/trace/events/gfpflags.h1
-rw-r--r--mm/page_alloc.c7
4 files changed, 10 insertions, 17 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index ec794a72975d..374c46dff7dd 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1077,8 +1077,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
1077 * until the request succeeds or until the allocation size falls below 1077 * until the request succeeds or until the allocation size falls below
1078 * the system page size. This attempts to make sure it does not adversely 1078 * the system page size. This attempts to make sure it does not adversely
1079 * impact system performance, so when allocating more than one page, we 1079 * impact system performance, so when allocating more than one page, we
1080 * ask the memory allocator to avoid re-trying, swapping, writing back 1080 * ask the memory allocator to avoid re-trying.
1081 * or performing I/O.
1082 * 1081 *
1083 * Note, this function also makes sure that the allocated buffer is aligned to 1082 * Note, this function also makes sure that the allocated buffer is aligned to
1084 * the MTD device's min. I/O unit, i.e. the "mtd->writesize" value. 1083 * the MTD device's min. I/O unit, i.e. the "mtd->writesize" value.
@@ -1092,8 +1091,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
1092 */ 1091 */
1093void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size) 1092void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
1094{ 1093{
1095 gfp_t flags = __GFP_NOWARN | __GFP_WAIT | 1094 gfp_t flags = __GFP_NOWARN | __GFP_WAIT | __GFP_NORETRY;
1096 __GFP_NORETRY | __GFP_NO_KSWAPD;
1097 size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE); 1095 size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE);
1098 void *kbuf; 1096 void *kbuf;
1099 1097
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index d0a79678f169..76e1aa206f57 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -30,10 +30,9 @@ struct vm_area_struct;
30#define ___GFP_HARDWALL 0x20000u 30#define ___GFP_HARDWALL 0x20000u
31#define ___GFP_THISNODE 0x40000u 31#define ___GFP_THISNODE 0x40000u
32#define ___GFP_RECLAIMABLE 0x80000u 32#define ___GFP_RECLAIMABLE 0x80000u
33#define ___GFP_NOTRACK 0x200000u 33#define ___GFP_NOTRACK 0x100000u
34#define ___GFP_NO_KSWAPD 0x400000u 34#define ___GFP_OTHER_NODE 0x200000u
35#define ___GFP_OTHER_NODE 0x800000u 35#define ___GFP_WRITE 0x400000u
36#define ___GFP_WRITE 0x1000000u
37 36
38/* 37/*
39 * GFP bitmasks.. 38 * GFP bitmasks..
@@ -86,7 +85,6 @@ struct vm_area_struct;
86#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ 85#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
87#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ 86#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
88 87
89#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
90#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ 88#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */
91#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ 89#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */
92 90
@@ -96,7 +94,7 @@ struct vm_area_struct;
96 */ 94 */
97#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) 95#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
98 96
99#define __GFP_BITS_SHIFT 25 /* Room for N __GFP_FOO bits */ 97#define __GFP_BITS_SHIFT 23 /* Room for N __GFP_FOO bits */
100#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) 98#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
101 99
102/* This equals 0, but use constants in case they ever change */ 100/* This equals 0, but use constants in case they ever change */
@@ -116,8 +114,7 @@ struct vm_area_struct;
116 __GFP_MOVABLE) 114 __GFP_MOVABLE)
117#define GFP_IOFS (__GFP_IO | __GFP_FS) 115#define GFP_IOFS (__GFP_IO | __GFP_FS)
118#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ 116#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
119 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ 117 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN)
120 __GFP_NO_KSWAPD)
121 118
122#ifdef CONFIG_NUMA 119#ifdef CONFIG_NUMA
123#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 120#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h
index d6fd8e5b14b7..9391706e9254 100644
--- a/include/trace/events/gfpflags.h
+++ b/include/trace/events/gfpflags.h
@@ -36,7 +36,6 @@
36 {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ 36 {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \
37 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \ 37 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \
38 {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \ 38 {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \
39 {(unsigned long)__GFP_NO_KSWAPD, "GFP_NO_KSWAPD"}, \
40 {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \ 39 {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \
41 ) : "GFP_NOWAIT" 40 ) : "GFP_NOWAIT"
42 41
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 7e208f0ad68c..8193809f3de0 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2416,9 +2416,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
2416 goto nopage; 2416 goto nopage;
2417 2417
2418restart: 2418restart:
2419 if (!(gfp_mask & __GFP_NO_KSWAPD)) 2419 wake_all_kswapd(order, zonelist, high_zoneidx,
2420 wake_all_kswapd(order, zonelist, high_zoneidx, 2420 zone_idx(preferred_zone));
2421 zone_idx(preferred_zone));
2422 2421
2423 /* 2422 /*
2424 * OK, we're below the kswapd watermark and have kicked background 2423 * OK, we're below the kswapd watermark and have kicked background
@@ -2495,7 +2494,7 @@ rebalance:
2495 * system then fail the allocation instead of entering direct reclaim. 2494 * system then fail the allocation instead of entering direct reclaim.
2496 */ 2495 */
2497 if ((deferred_compaction || contended_compaction) && 2496 if ((deferred_compaction || contended_compaction) &&
2498 (gfp_mask & __GFP_NO_KSWAPD)) 2497 (gfp_mask & (__GFP_MOVABLE|__GFP_REPEAT)) == __GFP_MOVABLE)
2499 goto nopage; 2498 goto nopage;
2500 2499
2501 /* Try direct reclaim and then allocating */ 2500 /* Try direct reclaim and then allocating */