aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gfp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/gfp.h')
-rw-r--r--include/linux/gfp.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 1e49be49d324..4883f393f50a 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -23,6 +23,7 @@ struct vm_area_struct;
23#define ___GFP_REPEAT 0x400u 23#define ___GFP_REPEAT 0x400u
24#define ___GFP_NOFAIL 0x800u 24#define ___GFP_NOFAIL 0x800u
25#define ___GFP_NORETRY 0x1000u 25#define ___GFP_NORETRY 0x1000u
26#define ___GFP_MEMALLOC 0x2000u
26#define ___GFP_COMP 0x4000u 27#define ___GFP_COMP 0x4000u
27#define ___GFP_ZERO 0x8000u 28#define ___GFP_ZERO 0x8000u
28#define ___GFP_NOMEMALLOC 0x10000u 29#define ___GFP_NOMEMALLOC 0x10000u
@@ -76,9 +77,14 @@ struct vm_area_struct;
76#define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */ 77#define __GFP_REPEAT ((__force gfp_t)___GFP_REPEAT) /* See above */
77#define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */ 78#define __GFP_NOFAIL ((__force gfp_t)___GFP_NOFAIL) /* See above */
78#define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */ 79#define __GFP_NORETRY ((__force gfp_t)___GFP_NORETRY) /* See above */
80#define __GFP_MEMALLOC ((__force gfp_t)___GFP_MEMALLOC)/* Allow access to emergency reserves */
79#define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */ 81#define __GFP_COMP ((__force gfp_t)___GFP_COMP) /* Add compound page metadata */
80#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */ 82#define __GFP_ZERO ((__force gfp_t)___GFP_ZERO) /* Return zeroed page on success */
81#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves */ 83#define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) /* Don't use emergency reserves.
84 * This takes precedence over the
85 * __GFP_MEMALLOC flag if both are
86 * set
87 */
82#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */ 88#define __GFP_HARDWALL ((__force gfp_t)___GFP_HARDWALL) /* Enforce hardwall cpuset memory allocs */
83#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */ 89#define __GFP_THISNODE ((__force gfp_t)___GFP_THISNODE)/* No fallback, no policies */
84#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ 90#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
@@ -129,7 +135,7 @@ struct vm_area_struct;
129/* Control page allocator reclaim behavior */ 135/* Control page allocator reclaim behavior */
130#define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ 136#define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\
131 __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ 137 __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\
132 __GFP_NORETRY|__GFP_NOMEMALLOC) 138 __GFP_NORETRY|__GFP_MEMALLOC|__GFP_NOMEMALLOC)
133 139
134/* Control slab gfp mask during early boot */ 140/* Control slab gfp mask during early boot */
135#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS)) 141#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS))
@@ -379,6 +385,9 @@ void drain_local_pages(void *dummy);
379 */ 385 */
380extern gfp_t gfp_allowed_mask; 386extern gfp_t gfp_allowed_mask;
381 387
388/* Returns true if the gfp_mask allows use of ALLOC_NO_WATERMARK */
389bool gfp_pfmemalloc_allowed(gfp_t gfp_mask);
390
382extern void pm_restrict_gfp_mask(void); 391extern void pm_restrict_gfp_mask(void);
383extern void pm_restore_gfp_mask(void); 392extern void pm_restore_gfp_mask(void);
384 393