Skip to content

Commit 521fe1d

Browse files
gormanmgregkh
authored andcommitted
mm, sl[au]b: add __GFP_ATOMIC to the GFP reclaim mask
commit e838a45 upstream. Commit d0164ad ("mm, page_alloc: distinguish between being unable to sleep, unwilling to sleep and avoiding waking kswapd") modified __GFP_WAIT to explicitly identify the difference between atomic callers and those that were unwilling to sleep. Later the definition was removed entirely. The GFP_RECLAIM_MASK is the set of flags that affect watermark checking and reclaim behaviour but __GFP_ATOMIC was never added. Without it, atomic users of the slab allocator strip the __GFP_ATOMIC flag and cannot access the page allocator atomic reserves. This patch addresses the problem. The user-visible impact depends on the workload but potentially atomic allocations unnecessarily fail without this path. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Mel Gorman <[email protected]> Reported-by: Marcin Wojtas <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Acked-by: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f883b92 commit 521fe1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mm/internal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
*/
2525
#define GFP_RECLAIM_MASK (__GFP_RECLAIM|__GFP_HIGH|__GFP_IO|__GFP_FS|\
2626
__GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
27-
__GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC)
27+
__GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC|\
28+
__GFP_ATOMIC)
2829

2930
/* The GFP flags allowed during early boot */
3031
#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_RECLAIM|__GFP_IO|__GFP_FS))

0 commit comments

Comments
 (0)