aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/mtdcore.c6
-rw-r--r--include/linux/gfp.h5
-rw-r--r--include/trace/events/gfpflags.h1
-rw-r--r--mm/page_alloc.c7
4 files changed, 6 insertions, 13 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 575730744fd..b9adff543f5 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1056,8 +1056,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
1056 * until the request succeeds or until the allocation size falls below 1056 * until the request succeeds or until the allocation size falls below
1057 * the system page size. This attempts to make sure it does not adversely 1057 * the system page size. This attempts to make sure it does not adversely
1058 * impact system performance, so when allocating more than one page, we 1058 * impact system performance, so when allocating more than one page, we
1059 * ask the memory allocator to avoid re-trying, swapping, writing back 1059 * ask the memory allocator to avoid re-trying.
1060 * or performing I/O.
1061 * 1060 *
1062 * Note, this function also makes sure that the allocated buffer is aligned to 1061 * Note, this function also makes sure that the allocated buffer is aligned to
1063 * the MTD device's min. I/O unit, i.e. the "mtd->writesize" value. 1062 * the MTD device's min. I/O unit, i.e. the "mtd->writesize" value.
@@ -1071,8 +1070,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
1071 */ 1070 */
1072void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size) 1071void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
1073{ 1072{
1074 gfp_t flags = __GFP_NOWARN | __GFP_WAIT | 1073 gfp_t flags = __GFP_NOWARN | __GFP_WAIT | __GFP_NORETRY;
1075 __GFP_NORETRY | __GFP_NO_KSWAPD;
1076 size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE); 1074 size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE);
1077 void *kbuf; 1075 void *kbuf;
1078 1076
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4883f393f50..f9bc873ce7d 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -35,7 +35,6 @@ struct vm_area_struct;
35#else 35#else
36#define ___GFP_NOTRACK 0 36#define ___GFP_NOTRACK 0
37#endif 37#endif
38#define ___GFP_NO_KSWAPD 0x400000u
39#define ___GFP_OTHER_NODE 0x800000u 38#define ___GFP_OTHER_NODE 0x800000u
40#define ___GFP_WRITE 0x1000000u 39#define ___GFP_WRITE 0x1000000u
41 40
@@ -90,7 +89,6 @@ struct vm_area_struct;
90#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ 89#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
91#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ 90#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
92 91
93#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
94#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ 92#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */
95#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ 93#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */
96 94
@@ -120,8 +118,7 @@ struct vm_area_struct;
120 __GFP_MOVABLE) 118 __GFP_MOVABLE)
121#define GFP_IOFS (__GFP_IO | __GFP_FS) 119#define GFP_IOFS (__GFP_IO | __GFP_FS)
122#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ 120#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
123 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ 121 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN)
124 __GFP_NO_KSWAPD)
125 122
126#ifdef CONFIG_NUMA 123#ifdef CONFIG_NUMA
127#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 124#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h
index d6fd8e5b14b..9391706e925 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 c13ea753889..5e92698e539 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2362,9 +2362,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
2362 goto nopage; 2362 goto nopage;
2363 2363
2364restart: 2364restart:
2365 if (!(gfp_mask & __GFP_NO_KSWAPD)) 2365 wake_all_kswapd(order, zonelist, high_zoneidx,
2366 wake_all_kswapd(order, zonelist, high_zoneidx, 2366 zone_idx(preferred_zone));
2367 zone_idx(preferred_zone));
2368 2367
2369 /* 2368 /*
2370 * OK, we're below the kswapd watermark and have kicked background 2369 * OK, we're below the kswapd watermark and have kicked background
@@ -2441,7 +2440,7 @@ rebalance:
2441 * system then fail the allocation instead of entering direct reclaim. 2440 * system then fail the allocation instead of entering direct reclaim.
2442 */ 2441 */
2443 if ((deferred_compaction || contended_compaction) && 2442 if ((deferred_compaction || contended_compaction) &&
2444 (gfp_mask & __GFP_NO_KSWAPD)) 2443 (gfp_mask & (__GFP_MOVABLE|__GFP_REPEAT)) == __GFP_MOVABLE)
2445 goto nopage; 2444 goto nopage;
2446 2445
2447 /* Try direct reclaim and then allocating */ 2446 /* Try direct reclaim and then allocating */