1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_PAGE_OWNER_H
3 #define __LINUX_PAGE_OWNER_H
5 #include <linux/jump_label.h>
7 #ifdef CONFIG_PAGE_OWNER
8 extern struct static_key_false page_owner_inited;
9 extern struct page_ext_operations page_owner_ops;
11 extern void __reset_page_owner(struct page *page, unsigned int order);
12 extern void __set_page_owner(struct page *page,
13 unsigned int order, gfp_t gfp_mask);
14 extern void __split_page_owner(struct page *page, unsigned int nr);
15 extern void __copy_page_owner(struct page *oldpage, struct page *newpage);
16 extern void __set_page_owner_migrate_reason(struct page *page, int reason);
17 extern void __dump_page_owner(const struct page *page);
18 extern void pagetypeinfo_showmixedcount_print(struct seq_file *m,
19 pg_data_t *pgdat, struct zone *zone);
21 static inline void reset_page_owner(struct page *page, unsigned int order)
23 if (static_branch_unlikely(&page_owner_inited))
24 __reset_page_owner(page, order);
27 static inline void set_page_owner(struct page *page,
28 unsigned int order, gfp_t gfp_mask)
30 if (static_branch_unlikely(&page_owner_inited))
31 __set_page_owner(page, order, gfp_mask);
34 static inline void split_page_owner(struct page *page, unsigned int nr)
36 if (static_branch_unlikely(&page_owner_inited))
37 __split_page_owner(page, nr);
39 static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
41 if (static_branch_unlikely(&page_owner_inited))
42 __copy_page_owner(oldpage, newpage);
44 static inline void set_page_owner_migrate_reason(struct page *page, int reason)
46 if (static_branch_unlikely(&page_owner_inited))
47 __set_page_owner_migrate_reason(page, reason);
49 static inline void dump_page_owner(const struct page *page)
51 if (static_branch_unlikely(&page_owner_inited))
52 __dump_page_owner(page);
55 static inline void reset_page_owner(struct page *page, unsigned int order)
58 static inline void set_page_owner(struct page *page,
59 unsigned int order, gfp_t gfp_mask)
62 static inline void split_page_owner(struct page *page,
66 static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
69 static inline void set_page_owner_migrate_reason(struct page *page, int reason)
72 static inline void dump_page_owner(const struct page *page)
75 #endif /* CONFIG_PAGE_OWNER */
76 #endif /* __LINUX_PAGE_OWNER_H */