Skip to content

Commit 16f5dfb

Browse files
Matthew Wilcox (Oracle)akpm00
authored andcommitted
gfp: include __GFP_NOWARN in GFP_NOWAIT
GFP_NOWAIT callers are always prepared for their allocations to fail because they fail so frequently. Forcing the callers to remember to add __GFP_NOWARN is just annoying and leads to an endless stream of patches for the places where we forgot to add it. We can now remove __GFP_NOWARN from all the callers which specify GFP_NOWAIT, but I'd rather wait a cycle and send patches to each maintainer instead of creating a big pile of merge conflicts. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 17b46e7 commit 16f5dfb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/linux/gfp_types.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ typedef unsigned int __bitwise gfp_t;
274274
* accounted to kmemcg.
275275
*
276276
* %GFP_NOWAIT is for kernel allocations that should not stall for direct
277-
* reclaim, start physical IO or use any filesystem callback.
277+
* reclaim, start physical IO or use any filesystem callback. It is very
278+
* likely to fail to allocate memory, even for very small allocations.
278279
*
279280
* %GFP_NOIO will use direct reclaim to discard clean pages or slab pages
280281
* that do not require the starting of any physical IO.
@@ -325,7 +326,7 @@ typedef unsigned int __bitwise gfp_t;
325326
#define GFP_ATOMIC (__GFP_HIGH|__GFP_KSWAPD_RECLAIM)
326327
#define GFP_KERNEL (__GFP_RECLAIM | __GFP_IO | __GFP_FS)
327328
#define GFP_KERNEL_ACCOUNT (GFP_KERNEL | __GFP_ACCOUNT)
328-
#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM)
329+
#define GFP_NOWAIT (__GFP_KSWAPD_RECLAIM | __GFP_NOWARN)
329330
#define GFP_NOIO (__GFP_RECLAIM)
330331
#define GFP_NOFS (__GFP_RECLAIM | __GFP_IO)
331332
#define GFP_USER (__GFP_RECLAIM | __GFP_IO | __GFP_FS | __GFP_HARDWALL)

0 commit comments

Comments
 (0)