1 #ifndef __LINUX_PAGE_OWNER_H
2 #define __LINUX_PAGE_OWNER_H
4 #include <linux/jump_label.h>
6 #ifdef CONFIG_PAGE_OWNER
7 extern struct static_key_false page_owner_inited;
8 extern struct page_ext_operations page_owner_ops;
10 extern void __reset_page_owner(struct page *page, unsigned int order);
11 extern void __set_page_owner(struct page *page,
12 unsigned int order, gfp_t gfp_mask);
13 extern void __split_page_owner(struct page *page, unsigned int order);
14 extern void __copy_page_owner(struct page *oldpage, struct page *newpage);
15 extern void __set_page_owner_migrate_reason(struct page *page, int reason);
16 extern void __dump_page_owner(struct page *page);
17 extern void pagetypeinfo_showmixedcount_print(struct seq_file *m,
18 pg_data_t *pgdat, struct zone *zone);
20 static inline void reset_page_owner(struct page *page, unsigned int order)
22 if (static_branch_unlikely(&page_owner_inited))
23 __reset_page_owner(page, order);
26 static inline void set_page_owner(struct page *page,
27 unsigned int order, gfp_t gfp_mask)
29 if (static_branch_unlikely(&page_owner_inited))
30 __set_page_owner(page, order, gfp_mask);
33 static inline void split_page_owner(struct page *page, unsigned int order)
35 if (static_branch_unlikely(&page_owner_inited))
36 __split_page_owner(page, order);
38 static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
40 if (static_branch_unlikely(&page_owner_inited))
41 __copy_page_owner(oldpage, newpage);
43 static inline void set_page_owner_migrate_reason(struct page *page, int reason)
45 if (static_branch_unlikely(&page_owner_inited))
46 __set_page_owner_migrate_reason(page, reason);
48 static inline void dump_page_owner(struct page *page)
50 if (static_branch_unlikely(&page_owner_inited))
51 __dump_page_owner(page);
54 static inline void reset_page_owner(struct page *page, unsigned int order)
57 static inline void set_page_owner(struct page *page,
58 unsigned int order, gfp_t gfp_mask)
61 static inline void split_page_owner(struct page *page,
65 static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
68 static inline void set_page_owner_migrate_reason(struct page *page, int reason)
71 static inline void dump_page_owner(struct page *page)
74 #endif /* CONFIG_PAGE_OWNER */
75 #endif /* __LINUX_PAGE_OWNER_H */