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 gfp_t __get_page_owner_gfp(struct page *page);
14 extern void __copy_page_owner(struct page *oldpage, struct page *newpage);
16 static inline void reset_page_owner(struct page *page, unsigned int order)
18 if (static_branch_unlikely(&page_owner_inited))
19 __reset_page_owner(page, order);
22 static inline void set_page_owner(struct page *page,
23 unsigned int order, gfp_t gfp_mask)
25 if (static_branch_unlikely(&page_owner_inited))
26 __set_page_owner(page, order, gfp_mask);
29 static inline gfp_t get_page_owner_gfp(struct page *page)
31 if (static_branch_unlikely(&page_owner_inited))
32 return __get_page_owner_gfp(page);
36 static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
38 if (static_branch_unlikely(&page_owner_inited))
39 __copy_page_owner(oldpage, newpage);
42 static inline void reset_page_owner(struct page *page, unsigned int order)
45 static inline void set_page_owner(struct page *page,
46 unsigned int order, gfp_t gfp_mask)
49 static inline gfp_t get_page_owner_gfp(struct page *page)
53 static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
56 #endif /* CONFIG_PAGE_OWNER */
57 #endif /* __LINUX_PAGE_OWNER_H */