1 #ifndef __LINUX_PAGE_EXT_H
2 #define __LINUX_PAGE_EXT_H
4 #include <linux/types.h>
5 #include <linux/stacktrace.h>
8 struct page_ext_operations {
13 #ifdef CONFIG_PAGE_EXTENSION
16 * page_ext->flags bits:
18 * PAGE_EXT_DEBUG_POISON is set for poisoned pages. This is used to
19 * implement generic debug pagealloc feature. The pages are filled with
20 * poison patterns and set this flag after free_pages(). The poisoned
21 * pages are verified whether the patterns are not corrupted and clear
22 * the flag before alloc_pages().
26 PAGE_EXT_DEBUG_POISON, /* Page is poisoned */
29 #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
36 * Page Extension can be considered as an extended mem_map.
37 * A page_ext page is associated with every page descriptor. The
38 * page_ext helps us add more information about the page.
39 * All page_ext are allocated at boot or memory hotplug event,
40 * then the page_ext for pfn always exists.
44 #ifdef CONFIG_PAGE_OWNER
47 unsigned int nr_entries;
48 unsigned long trace_entries[8];
52 extern void pgdat_page_ext_init(struct pglist_data *pgdat);
54 #ifdef CONFIG_SPARSEMEM
55 static inline void page_ext_init_flatmem(void)
58 extern void page_ext_init(void);
60 extern void page_ext_init_flatmem(void);
61 static inline void page_ext_init(void)
66 struct page_ext *lookup_page_ext(struct page *page);
68 #else /* !CONFIG_PAGE_EXTENSION */
71 static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
75 static inline struct page_ext *lookup_page_ext(struct page *page)
80 static inline void page_ext_init(void)
84 static inline void page_ext_init_flatmem(void)
87 #endif /* CONFIG_PAGE_EXTENSION */
88 #endif /* __LINUX_PAGE_EXT_H */