diff options
author | Vlastimil Babka <vbabka@suse.cz> | 2016-03-15 17:55:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-15 19:55:16 -0400 |
commit | 1f7866b4aebd19e2525775083279e171b36783a4 (patch) | |
tree | 9c4ba6b82620639e0f529d6be199675384b4273f /include | |
parent | 20f6e03a40ba536dfc7c6f83dd894d994aeb39f3 (diff) |
mm, tracing: make show_gfp_flags() up to date
The show_gfp_flags() macro provides human-friendly printing of gfp flags
in tracepoints. However, it is somewhat out of date and missing several
flags. This patches fills in the missing flags, and distinguishes
properly between GFP_ATOMIC and __GFP_ATOMIC which were both translated
to "GFP_ATOMIC". More generally, all __GFP_X flags which were
previously printed as GFP_X, are now printed as __GFP_X, since ommiting
the underscores results in output that doesn't actually match the source
code, and can only lead to confusion. Where both variants are defined
equal (e.g. _DMA and _DMA32), the variant without underscores are
preferred.
Also add a note in gfp.h so hopefully future changes will be synced
better.
__GFP_MOVABLE is defined twice in include/linux/gfp.h with different
comments. Leave just the newer one, which was intended to replace the
old one.
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Michal Hocko <mhocko@suse.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/gfp.h | 6 | ||||
-rw-r--r-- | include/trace/events/gfpflags.h | 53 |
2 files changed, 36 insertions, 23 deletions
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index af1f2b24bbe4..bbe5e7fae337 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -9,6 +9,11 @@ | |||
9 | 9 | ||
10 | struct vm_area_struct; | 10 | struct vm_area_struct; |
11 | 11 | ||
12 | /* | ||
13 | * In case of changes, please don't forget to update | ||
14 | * include/trace/events/gfpflags.h | ||
15 | */ | ||
16 | |||
12 | /* Plain integer GFP bitmasks. Do not use this directly. */ | 17 | /* Plain integer GFP bitmasks. Do not use this directly. */ |
13 | #define ___GFP_DMA 0x01u | 18 | #define ___GFP_DMA 0x01u |
14 | #define ___GFP_HIGHMEM 0x02u | 19 | #define ___GFP_HIGHMEM 0x02u |
@@ -48,7 +53,6 @@ struct vm_area_struct; | |||
48 | #define __GFP_DMA ((__force gfp_t)___GFP_DMA) | 53 | #define __GFP_DMA ((__force gfp_t)___GFP_DMA) |
49 | #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM) | 54 | #define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM) |
50 | #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32) | 55 | #define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32) |
51 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */ | ||
52 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */ | 56 | #define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */ |
53 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) | 57 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) |
54 | 58 | ||
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h index dde6bf092c8a..f53b216c9311 100644 --- a/include/trace/events/gfpflags.h +++ b/include/trace/events/gfpflags.h | |||
@@ -11,33 +11,42 @@ | |||
11 | #define show_gfp_flags(flags) \ | 11 | #define show_gfp_flags(flags) \ |
12 | (flags) ? __print_flags(flags, "|", \ | 12 | (flags) ? __print_flags(flags, "|", \ |
13 | {(unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \ | 13 | {(unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \ |
14 | {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"}, \ | 14 | {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"},\ |
15 | {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ | 15 | {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ |
16 | {(unsigned long)GFP_USER, "GFP_USER"}, \ | 16 | {(unsigned long)GFP_USER, "GFP_USER"}, \ |
17 | {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ | 17 | {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ |
18 | {(unsigned long)GFP_KERNEL_ACCOUNT, "GFP_KERNEL_ACCOUNT"}, \ | ||
18 | {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ | 19 | {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ |
19 | {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ | 20 | {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ |
20 | {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ | 21 | {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ |
21 | {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ | 22 | {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ |
22 | {(unsigned long)__GFP_HIGH, "GFP_HIGH"}, \ | 23 | {(unsigned long)GFP_NOWAIT, "GFP_NOWAIT"}, \ |
23 | {(unsigned long)__GFP_ATOMIC, "GFP_ATOMIC"}, \ | 24 | {(unsigned long)GFP_DMA, "GFP_DMA"}, \ |
24 | {(unsigned long)__GFP_IO, "GFP_IO"}, \ | 25 | {(unsigned long)__GFP_HIGHMEM, "__GFP_HIGHMEM"}, \ |
25 | {(unsigned long)__GFP_COLD, "GFP_COLD"}, \ | 26 | {(unsigned long)GFP_DMA32, "GFP_DMA32"}, \ |
26 | {(unsigned long)__GFP_NOWARN, "GFP_NOWARN"}, \ | 27 | {(unsigned long)__GFP_HIGH, "__GFP_HIGH"}, \ |
27 | {(unsigned long)__GFP_REPEAT, "GFP_REPEAT"}, \ | 28 | {(unsigned long)__GFP_ATOMIC, "__GFP_ATOMIC"}, \ |
28 | {(unsigned long)__GFP_NOFAIL, "GFP_NOFAIL"}, \ | 29 | {(unsigned long)__GFP_IO, "__GFP_IO"}, \ |
29 | {(unsigned long)__GFP_NORETRY, "GFP_NORETRY"}, \ | 30 | {(unsigned long)__GFP_FS, "__GFP_FS"}, \ |
30 | {(unsigned long)__GFP_COMP, "GFP_COMP"}, \ | 31 | {(unsigned long)__GFP_COLD, "__GFP_COLD"}, \ |
31 | {(unsigned long)__GFP_ZERO, "GFP_ZERO"}, \ | 32 | {(unsigned long)__GFP_NOWARN, "__GFP_NOWARN"}, \ |
32 | {(unsigned long)__GFP_NOMEMALLOC, "GFP_NOMEMALLOC"}, \ | 33 | {(unsigned long)__GFP_REPEAT, "__GFP_REPEAT"}, \ |
33 | {(unsigned long)__GFP_MEMALLOC, "GFP_MEMALLOC"}, \ | 34 | {(unsigned long)__GFP_NOFAIL, "__GFP_NOFAIL"}, \ |
34 | {(unsigned long)__GFP_HARDWALL, "GFP_HARDWALL"}, \ | 35 | {(unsigned long)__GFP_NORETRY, "__GFP_NORETRY"}, \ |
35 | {(unsigned long)__GFP_THISNODE, "GFP_THISNODE"}, \ | 36 | {(unsigned long)__GFP_COMP, "__GFP_COMP"}, \ |
36 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | 37 | {(unsigned long)__GFP_ZERO, "__GFP_ZERO"}, \ |
37 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \ | 38 | {(unsigned long)__GFP_NOMEMALLOC, "__GFP_NOMEMALLOC"}, \ |
38 | {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \ | 39 | {(unsigned long)__GFP_MEMALLOC, "__GFP_MEMALLOC"}, \ |
39 | {(unsigned long)__GFP_DIRECT_RECLAIM, "GFP_DIRECT_RECLAIM"}, \ | 40 | {(unsigned long)__GFP_HARDWALL, "__GFP_HARDWALL"}, \ |
40 | {(unsigned long)__GFP_KSWAPD_RECLAIM, "GFP_KSWAPD_RECLAIM"}, \ | 41 | {(unsigned long)__GFP_THISNODE, "__GFP_THISNODE"}, \ |
41 | {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \ | 42 | {(unsigned long)__GFP_RECLAIMABLE, "__GFP_RECLAIMABLE"}, \ |
42 | ) : "GFP_NOWAIT" | 43 | {(unsigned long)__GFP_MOVABLE, "__GFP_MOVABLE"}, \ |
44 | {(unsigned long)__GFP_ACCOUNT, "__GFP_ACCOUNT"}, \ | ||
45 | {(unsigned long)__GFP_NOTRACK, "__GFP_NOTRACK"}, \ | ||
46 | {(unsigned long)__GFP_WRITE, "__GFP_WRITE"}, \ | ||
47 | {(unsigned long)__GFP_RECLAIM, "__GFP_RECLAIM"}, \ | ||
48 | {(unsigned long)__GFP_DIRECT_RECLAIM, "__GFP_DIRECT_RECLAIM"},\ | ||
49 | {(unsigned long)__GFP_KSWAPD_RECLAIM, "__GFP_KSWAPD_RECLAIM"},\ | ||
50 | {(unsigned long)__GFP_OTHER_NODE, "__GFP_OTHER_NODE"} \ | ||
51 | ) : "none" | ||
43 | 52 | ||