ASoC: rt5663: fix a debug statement
[linux-2.6/btrfs-unstable.git] / include / linux / page_ext.h
blob03f2a3e7d76d40ee457b8ab6f2d140d1ee9475b1
1 #ifndef __LINUX_PAGE_EXT_H
2 #define __LINUX_PAGE_EXT_H
4 #include <linux/types.h>
5 #include <linux/stacktrace.h>
6 #include <linux/stackdepot.h>
8 struct pglist_data;
9 struct page_ext_operations {
10 bool (*need)(void);
11 void (*init)(void);
14 #ifdef CONFIG_PAGE_EXTENSION
17 * page_ext->flags bits:
19 * PAGE_EXT_DEBUG_POISON is set for poisoned pages. This is used to
20 * implement generic debug pagealloc feature. The pages are filled with
21 * poison patterns and set this flag after free_pages(). The poisoned
22 * pages are verified whether the patterns are not corrupted and clear
23 * the flag before alloc_pages().
26 enum page_ext_flags {
27 PAGE_EXT_DEBUG_POISON, /* Page is poisoned */
28 PAGE_EXT_DEBUG_GUARD,
29 PAGE_EXT_OWNER,
30 #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
31 PAGE_EXT_YOUNG,
32 PAGE_EXT_IDLE,
33 #endif
37 * Page Extension can be considered as an extended mem_map.
38 * A page_ext page is associated with every page descriptor. The
39 * page_ext helps us add more information about the page.
40 * All page_ext are allocated at boot or memory hotplug event,
41 * then the page_ext for pfn always exists.
43 struct page_ext {
44 unsigned long flags;
45 #ifdef CONFIG_PAGE_OWNER
46 unsigned int order;
47 gfp_t gfp_mask;
48 int last_migrate_reason;
49 depot_stack_handle_t handle;
50 #endif
53 extern void pgdat_page_ext_init(struct pglist_data *pgdat);
55 #ifdef CONFIG_SPARSEMEM
56 static inline void page_ext_init_flatmem(void)
59 extern void page_ext_init(void);
60 #else
61 extern void page_ext_init_flatmem(void);
62 static inline void page_ext_init(void)
65 #endif
67 struct page_ext *lookup_page_ext(struct page *page);
69 #else /* !CONFIG_PAGE_EXTENSION */
70 struct page_ext;
72 static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
76 static inline struct page_ext *lookup_page_ext(struct page *page)
78 return NULL;
81 static inline void page_ext_init(void)
85 static inline void page_ext_init_flatmem(void)
88 #endif /* CONFIG_PAGE_EXTENSION */
89 #endif /* __LINUX_PAGE_EXT_H */