Rev 6936 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6936 | Rev 7143 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | #include |
6 | #include |
7 | #include |
7 | #include |
Line 8... | Line 8... | ||
8 | 8 | ||
Line -... | Line 9... | ||
- | 9 | struct vm_area_struct; |
|
- | 10 | ||
- | 11 | /* |
|
- | 12 | * In case of changes, please don't forget to update |
|
- | 13 | * include/trace/events/mmflags.h and tools/perf/builtin-kmem.c |
|
9 | struct vm_area_struct; |
14 | */ |
10 | 15 | ||
11 | /* Plain integer GFP bitmasks. Do not use this directly. */ |
16 | /* Plain integer GFP bitmasks. Do not use this directly. */ |
12 | #define ___GFP_DMA 0x01u |
17 | #define ___GFP_DMA 0x01u |
13 | #define ___GFP_HIGHMEM 0x02u |
18 | #define ___GFP_HIGHMEM 0x02u |
Line 45... | Line 50... | ||
45 | * be used in bit comparisons. |
50 | * be used in bit comparisons. |
46 | */ |
51 | */ |
47 | #define __GFP_DMA ((__force gfp_t)___GFP_DMA) |
52 | #define __GFP_DMA ((__force gfp_t)___GFP_DMA) |
48 | #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM) |
53 | #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM) |
49 | #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32) |
54 | #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32) |
50 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */ |
- | |
51 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */ |
55 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */ |
52 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) |
56 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) |
Line 53... | Line 57... | ||
53 | 57 | ||
54 | /* |
58 | /* |
Line 98... | Line 102... | ||
98 | * very shortly e.g. process exiting or swapping. Users either should |
102 | * very shortly e.g. process exiting or swapping. Users either should |
99 | * be the MM or co-ordinating closely with the VM (e.g. swap over NFS). |
103 | * be the MM or co-ordinating closely with the VM (e.g. swap over NFS). |
100 | * |
104 | * |
101 | * __GFP_NOMEMALLOC is used to explicitly forbid access to emergency reserves. |
105 | * __GFP_NOMEMALLOC is used to explicitly forbid access to emergency reserves. |
102 | * This takes precedence over the __GFP_MEMALLOC flag if both are set. |
106 | * This takes precedence over the __GFP_MEMALLOC flag if both are set. |
103 | * |
- | |
104 | * __GFP_NOACCOUNT ignores the accounting for kmemcg limit enforcement. |
- | |
105 | */ |
107 | */ |
106 | #define __GFP_ATOMIC ((__force gfp_t)___GFP_ATOMIC) |
108 | #define __GFP_ATOMIC ((__force gfp_t)___GFP_ATOMIC) |
107 | #define __GFP_HIGH ((__force gfp_t)___GFP_HIGH) |
109 | #define __GFP_HIGH ((__force gfp_t)___GFP_HIGH) |
108 | #define __GFP_MEMALLOC ((__force gfp_t)___GFP_MEMALLOC) |
110 | #define __GFP_MEMALLOC ((__force gfp_t)___GFP_MEMALLOC) |
109 | #define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) |
111 | #define __GFP_NOMEMALLOC ((__force gfp_t)___GFP_NOMEMALLOC) |
Line 252... | Line 254... | ||
252 | #define GFP_DMA32 __GFP_DMA32 |
254 | #define GFP_DMA32 __GFP_DMA32 |
253 | #define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) |
255 | #define GFP_HIGHUSER (GFP_USER | __GFP_HIGHMEM) |
254 | #define GFP_HIGHUSER_MOVABLE (GFP_HIGHUSER | __GFP_MOVABLE) |
256 | #define GFP_HIGHUSER_MOVABLE (GFP_HIGHUSER | __GFP_MOVABLE) |
255 | #define GFP_TRANSHUGE ((GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ |
257 | #define GFP_TRANSHUGE ((GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ |
256 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) & \ |
258 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) & \ |
257 | ~__GFP_KSWAPD_RECLAIM) |
259 | ~__GFP_RECLAIM) |
- | 260 | ||
Line 258... | Line 261... | ||
258 | 261 | ||
259 | static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags) |
262 | static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags) |
260 | { |
263 | { |
261 | return !!(gfp_flags & __GFP_DIRECT_RECLAIM); |
264 | return !!(gfp_flags & __GFP_DIRECT_RECLAIM); |
Line 307... | Line 310... | ||
307 | * 0xc => DMA32 (MOVABLE+DMA32) |
310 | * 0xc => DMA32 (MOVABLE+DMA32) |
308 | * 0xd => BAD (MOVABLE+DMA32+DMA) |
311 | * 0xd => BAD (MOVABLE+DMA32+DMA) |
309 | * 0xe => BAD (MOVABLE+DMA32+HIGHMEM) |
312 | * 0xe => BAD (MOVABLE+DMA32+HIGHMEM) |
310 | * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA) |
313 | * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA) |
311 | * |
314 | * |
312 | * ZONES_SHIFT must be <= 2 on 32 bit platforms. |
315 | * GFP_ZONES_SHIFT must be <= 2 on 32 bit platforms. |
313 | */ |
316 | */ |
Line 314... | Line 317... | ||
314 | 317 | ||
315 | #if 16 * ZONES_SHIFT > BITS_PER_LONG |
318 | #if 16 * ZONES_SHIFT > BITS_PER_LONG |
316 | #error ZONES_SHIFT too large to create GFP_ZONE_TABLE integer |
319 | #error ZONES_SHIFT too large to create GFP_ZONE_TABLE integer |