1 /* 2 * The order of these masks is important. Matching masks will be seen 3 * first and the left over flags will end up showing by themselves. 4 * 5 * For example, if we have GFP_KERNEL before GFP_USER we wil get: 6 * 7 * GFP_KERNEL|GFP_HARDWALL 8 * 9 * Thus most bits set go first. 10 */ 11 12 #define __def_gfpflag_names \ 13 {(unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \ 14 {(unsigned long)GFP_TRANSHUGE_LIGHT, "GFP_TRANSHUGE_LIGHT"}, \ 15 {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"},\ 16 {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \ 17 {(unsigned long)GFP_USER, "GFP_USER"}, \ 18 {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \ 19 {(unsigned long)GFP_KERNEL_ACCOUNT, "GFP_KERNEL_ACCOUNT"}, \ 20 {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \ 21 {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \ 22 {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \ 23 {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \ 24 {(unsigned long)GFP_NOWAIT, "GFP_NOWAIT"}, \ 25 {(unsigned long)GFP_DMA, "GFP_DMA"}, \ 26 {(unsigned long)__GFP_HIGHMEM, "__GFP_HIGHMEM"}, \ 27 {(unsigned long)GFP_DMA32, "GFP_DMA32"}, \ 28 {(unsigned long)__GFP_HIGH, "__GFP_HIGH"}, \ 29 {(unsigned long)__GFP_ATOMIC, "__GFP_ATOMIC"}, \ 30 {(unsigned long)__GFP_IO, "__GFP_IO"}, \ 31 {(unsigned long)__GFP_FS, "__GFP_FS"}, \ 32 {(unsigned long)__GFP_COLD, "__GFP_COLD"}, \ 33 {(unsigned long)__GFP_NOWARN, "__GFP_NOWARN"}, \ 34 {(unsigned long)__GFP_REPEAT, "__GFP_REPEAT"}, \ 35 {(unsigned long)__GFP_NOFAIL, "__GFP_NOFAIL"}, \ 36 {(unsigned long)__GFP_NORETRY, "__GFP_NORETRY"}, \ 37 {(unsigned long)__GFP_COMP, "__GFP_COMP"}, \ 38 {(unsigned long)__GFP_ZERO, "__GFP_ZERO"}, \ 39 {(unsigned long)__GFP_NOMEMALLOC, "__GFP_NOMEMALLOC"}, \ 40 {(unsigned long)__GFP_MEMALLOC, "__GFP_MEMALLOC"}, \ 41 {(unsigned long)__GFP_HARDWALL, "__GFP_HARDWALL"}, \ 42 {(unsigned long)__GFP_THISNODE, "__GFP_THISNODE"}, \ 43 {(unsigned long)__GFP_RECLAIMABLE, "__GFP_RECLAIMABLE"}, \ 44 {(unsigned long)__GFP_MOVABLE, "__GFP_MOVABLE"}, \ 45 {(unsigned long)__GFP_ACCOUNT, "__GFP_ACCOUNT"}, \ 46 {(unsigned long)__GFP_NOTRACK, "__GFP_NOTRACK"}, \ 47 {(unsigned long)__GFP_WRITE, "__GFP_WRITE"}, \ 48 {(unsigned long)__GFP_RECLAIM, "__GFP_RECLAIM"}, \ 49 {(unsigned long)__GFP_DIRECT_RECLAIM, "__GFP_DIRECT_RECLAIM"},\ 50 {(unsigned long)__GFP_KSWAPD_RECLAIM, "__GFP_KSWAPD_RECLAIM"},\ 51 {(unsigned long)__GFP_OTHER_NODE, "__GFP_OTHER_NODE"} \ 52 53 #define show_gfp_flags(flags) \ 54 (flags) ? __print_flags(flags, "|", \ 55 __def_gfpflag_names \ 56 ) : "none" 57 58 #ifdef CONFIG_MMU 59 #define IF_HAVE_PG_MLOCK(flag,string) ,{1UL << flag, string} 60 #else 61 #define IF_HAVE_PG_MLOCK(flag,string) 62 #endif 63 64 #ifdef CONFIG_ARCH_USES_PG_UNCACHED 65 #define IF_HAVE_PG_UNCACHED(flag,string) ,{1UL << flag, string} 66 #else 67 #define IF_HAVE_PG_UNCACHED(flag,string) 68 #endif 69 70 #ifdef CONFIG_MEMORY_FAILURE 71 #define IF_HAVE_PG_HWPOISON(flag,string) ,{1UL << flag, string} 72 #else 73 #define IF_HAVE_PG_HWPOISON(flag,string) 74 #endif 75 76 #if defined(CONFIG_IDLE_PAGE_TRACKING) && defined(CONFIG_64BIT) 77 #define IF_HAVE_PG_IDLE(flag,string) ,{1UL << flag, string} 78 #else 79 #define IF_HAVE_PG_IDLE(flag,string) 80 #endif 81 82 #define __def_pageflag_names \ 83 {1UL << PG_locked, "locked" }, \ 84 {1UL << PG_waiters, "waiters" }, \ 85 {1UL << PG_error, "error" }, \ 86 {1UL << PG_referenced, "referenced" }, \ 87 {1UL << PG_uptodate, "uptodate" }, \ 88 {1UL << PG_dirty, "dirty" }, \ 89 {1UL << PG_lru, "lru" }, \ 90 {1UL << PG_active, "active" }, \ 91 {1UL << PG_slab, "slab" }, \ 92 {1UL << PG_owner_priv_1, "owner_priv_1" }, \ 93 {1UL << PG_arch_1, "arch_1" }, \ 94 {1UL << PG_reserved, "reserved" }, \ 95 {1UL << PG_private, "private" }, \ 96 {1UL << PG_private_2, "private_2" }, \ 97 {1UL << PG_writeback, "writeback" }, \ 98 {1UL << PG_head, "head" }, \ 99 {1UL << PG_mappedtodisk, "mappedtodisk" }, \ 100 {1UL << PG_reclaim, "reclaim" }, \ 101 {1UL << PG_swapbacked, "swapbacked" }, \ 102 {1UL << PG_unevictable, "unevictable" } \ 103 IF_HAVE_PG_MLOCK(PG_mlocked, "mlocked" ) \ 104 IF_HAVE_PG_UNCACHED(PG_uncached, "uncached" ) \ 105 IF_HAVE_PG_HWPOISON(PG_hwpoison, "hwpoison" ) \ 106 IF_HAVE_PG_IDLE(PG_young, "young" ) \ 107 IF_HAVE_PG_IDLE(PG_idle, "idle" ) 108 109 #define show_page_flags(flags) \ 110 (flags) ? __print_flags(flags, "|", \ 111 __def_pageflag_names \ 112 ) : "none" 113 114 #if defined(CONFIG_X86) 115 #define __VM_ARCH_SPECIFIC_1 {VM_PAT, "pat" } 116 #elif defined(CONFIG_PPC) 117 #define __VM_ARCH_SPECIFIC_1 {VM_SAO, "sao" } 118 #elif defined(CONFIG_PARISC) || defined(CONFIG_METAG) || defined(CONFIG_IA64) 119 #define __VM_ARCH_SPECIFIC_1 {VM_GROWSUP, "growsup" } 120 #elif !defined(CONFIG_MMU) 121 #define __VM_ARCH_SPECIFIC_1 {VM_MAPPED_COPY,"mappedcopy" } 122 #else 123 #define __VM_ARCH_SPECIFIC_1 {VM_ARCH_1, "arch_1" } 124 #endif 125 126 #if defined(CONFIG_X86) 127 #define __VM_ARCH_SPECIFIC_2 {VM_MPX, "mpx" } 128 #else 129 #define __VM_ARCH_SPECIFIC_2 {VM_ARCH_2, "arch_2" } 130 #endif 131 132 #ifdef CONFIG_MEM_SOFT_DIRTY 133 #define IF_HAVE_VM_SOFTDIRTY(flag,name) {flag, name }, 134 #else 135 #define IF_HAVE_VM_SOFTDIRTY(flag,name) 136 #endif 137 138 #define __def_vmaflag_names \ 139 {VM_READ, "read" }, \ 140 {VM_WRITE, "write" }, \ 141 {VM_EXEC, "exec" }, \ 142 {VM_SHARED, "shared" }, \ 143 {VM_MAYREAD, "mayread" }, \ 144 {VM_MAYWRITE, "maywrite" }, \ 145 {VM_MAYEXEC, "mayexec" }, \ 146 {VM_MAYSHARE, "mayshare" }, \ 147 {VM_GROWSDOWN, "growsdown" }, \ 148 {VM_UFFD_MISSING, "uffd_missing" }, \ 149 {VM_PFNMAP, "pfnmap" }, \ 150 {VM_DENYWRITE, "denywrite" }, \ 151 {VM_UFFD_WP, "uffd_wp" }, \ 152 {VM_LOCKED, "locked" }, \ 153 {VM_IO, "io" }, \ 154 {VM_SEQ_READ, "seqread" }, \ 155 {VM_RAND_READ, "randread" }, \ 156 {VM_DONTCOPY, "dontcopy" }, \ 157 {VM_DONTEXPAND, "dontexpand" }, \ 158 {VM_LOCKONFAULT, "lockonfault" }, \ 159 {VM_ACCOUNT, "account" }, \ 160 {VM_NORESERVE, "noreserve" }, \ 161 {VM_HUGETLB, "hugetlb" }, \ 162 __VM_ARCH_SPECIFIC_1 , \ 163 __VM_ARCH_SPECIFIC_2 , \ 164 {VM_DONTDUMP, "dontdump" }, \ 165 IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \ 166 {VM_MIXEDMAP, "mixedmap" }, \ 167 {VM_HUGEPAGE, "hugepage" }, \ 168 {VM_NOHUGEPAGE, "nohugepage" }, \ 169 {VM_MERGEABLE, "mergeable" } \ 170 171 #define show_vma_flags(flags) \ 172 (flags) ? __print_flags(flags, "|", \ 173 __def_vmaflag_names \ 174 ) : "none" 175