Skip to content

Commit a509153

Browse files
akpm00torvalds
authored andcommitted
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>
1 parent 60cefed commit a509153

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

drivers/mtd/mtdcore.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,8 +1077,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
10771077
* until the request succeeds or until the allocation size falls below
10781078
* the system page size. This attempts to make sure it does not adversely
10791079
* impact system performance, so when allocating more than one page, we
1080-
* ask the memory allocator to avoid re-trying, swapping, writing back
1081-
* or performing I/O.
1080+
* ask the memory allocator to avoid re-trying.
10821081
*
10831082
* Note, this function also makes sure that the allocated buffer is aligned to
10841083
* the MTD device's min. I/O unit, i.e. the "mtd->writesize" value.
@@ -1092,8 +1091,7 @@ EXPORT_SYMBOL_GPL(mtd_writev);
10921091
*/
10931092
void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size)
10941093
{
1095-
gfp_t flags = __GFP_NOWARN | __GFP_WAIT |
1096-
__GFP_NORETRY | __GFP_NO_KSWAPD;
1094+
gfp_t flags = __GFP_NOWARN | __GFP_WAIT | __GFP_NORETRY;
10971095
size_t min_alloc = max_t(size_t, mtd->writesize, PAGE_SIZE);
10981096
void *kbuf;
10991097

include/linux/gfp.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ struct vm_area_struct;
3030
#define ___GFP_HARDWALL 0x20000u
3131
#define ___GFP_THISNODE 0x40000u
3232
#define ___GFP_RECLAIMABLE 0x80000u
33-
#define ___GFP_NOTRACK 0x200000u
34-
#define ___GFP_NO_KSWAPD 0x400000u
35-
#define ___GFP_OTHER_NODE 0x800000u
36-
#define ___GFP_WRITE 0x1000000u
33+
#define ___GFP_NOTRACK 0x100000u
34+
#define ___GFP_OTHER_NODE 0x200000u
35+
#define ___GFP_WRITE 0x400000u
3736

3837
/*
3938
* GFP bitmasks..
@@ -86,7 +85,6 @@ struct vm_area_struct;
8685
#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
8786
#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
8887

89-
#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
9088
#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */
9189
#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */
9290

@@ -96,7 +94,7 @@ struct vm_area_struct;
9694
*/
9795
#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
9896

99-
#define __GFP_BITS_SHIFT 25 /* Room for N __GFP_FOO bits */
97+
#define __GFP_BITS_SHIFT 23 /* Room for N __GFP_FOO bits */
10098
#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
10199

102100
/* This equals 0, but use constants in case they ever change */
@@ -116,8 +114,7 @@ struct vm_area_struct;
116114
__GFP_MOVABLE)
117115
#define GFP_IOFS (__GFP_IO | __GFP_FS)
118116
#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
119-
__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \
120-
__GFP_NO_KSWAPD)
117+
__GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN)
121118

122119
#ifdef CONFIG_NUMA
123120
#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)

include/trace/events/gfpflags.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
{(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \
3737
{(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \
3838
{(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \
39-
{(unsigned long)__GFP_NO_KSWAPD, "GFP_NO_KSWAPD"}, \
4039
{(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \
4140
) : "GFP_NOWAIT"
4241

mm/page_alloc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,9 +2416,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
24162416
goto nopage;
24172417

24182418
restart:
2419-
if (!(gfp_mask & __GFP_NO_KSWAPD))
2420-
wake_all_kswapd(order, zonelist, high_zoneidx,
2421-
zone_idx(preferred_zone));
2419+
wake_all_kswapd(order, zonelist, high_zoneidx,
2420+
zone_idx(preferred_zone));
24222421

24232422
/*
24242423
* OK, we're below the kswapd watermark and have kicked background
@@ -2495,7 +2494,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
24952494
* system then fail the allocation instead of entering direct reclaim.
24962495
*/
24972496
if ((deferred_compaction || contended_compaction) &&
2498-
(gfp_mask & __GFP_NO_KSWAPD))
2497+
(gfp_mask & (__GFP_MOVABLE|__GFP_REPEAT)) == __GFP_MOVABLE)
24992498
goto nopage;
25002499

25012500
/* Try direct reclaim and then allocating */

0 commit comments

Comments
 (0)