]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/page_owner.h
ACPI: fix acpi_find_child_device() invocation in acpi_preset_companion()
[mirror_ubuntu-bionic-kernel.git] / include / linux / page_owner.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
48c96a36
JK
2#ifndef __LINUX_PAGE_OWNER_H
3#define __LINUX_PAGE_OWNER_H
4
7dd80b8a
VB
5#include <linux/jump_label.h>
6
48c96a36 7#ifdef CONFIG_PAGE_OWNER
7dd80b8a 8extern struct static_key_false page_owner_inited;
48c96a36
JK
9extern struct page_ext_operations page_owner_ops;
10
11extern void __reset_page_owner(struct page *page, unsigned int order);
12extern void __set_page_owner(struct page *page,
13 unsigned int order, gfp_t gfp_mask);
a9627bc5 14extern void __split_page_owner(struct page *page, unsigned int order);
d435edca 15extern void __copy_page_owner(struct page *oldpage, struct page *newpage);
7cd12b4a 16extern void __set_page_owner_migrate_reason(struct page *page, int reason);
4e462112 17extern void __dump_page_owner(struct page *page);
e2f612e6
JK
18extern void pagetypeinfo_showmixedcount_print(struct seq_file *m,
19 pg_data_t *pgdat, struct zone *zone);
48c96a36
JK
20
21static inline void reset_page_owner(struct page *page, unsigned int order)
22{
7dd80b8a
VB
23 if (static_branch_unlikely(&page_owner_inited))
24 __reset_page_owner(page, order);
48c96a36
JK
25}
26
27static inline void set_page_owner(struct page *page,
28 unsigned int order, gfp_t gfp_mask)
29{
7dd80b8a
VB
30 if (static_branch_unlikely(&page_owner_inited))
31 __set_page_owner(page, order, gfp_mask);
48c96a36 32}
e2cfc911 33
a9627bc5 34static inline void split_page_owner(struct page *page, unsigned int order)
e2cfc911 35{
7dd80b8a 36 if (static_branch_unlikely(&page_owner_inited))
a9627bc5 37 __split_page_owner(page, order);
e2cfc911 38}
d435edca
VB
39static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
40{
41 if (static_branch_unlikely(&page_owner_inited))
42 __copy_page_owner(oldpage, newpage);
43}
7cd12b4a
VB
44static inline void set_page_owner_migrate_reason(struct page *page, int reason)
45{
46 if (static_branch_unlikely(&page_owner_inited))
47 __set_page_owner_migrate_reason(page, reason);
48}
4e462112
VB
49static inline void dump_page_owner(struct page *page)
50{
51 if (static_branch_unlikely(&page_owner_inited))
52 __dump_page_owner(page);
53}
48c96a36
JK
54#else
55static inline void reset_page_owner(struct page *page, unsigned int order)
56{
57}
58static inline void set_page_owner(struct page *page,
59 unsigned int order, gfp_t gfp_mask)
60{
61}
a9627bc5
JK
62static inline void split_page_owner(struct page *page,
63 unsigned int order)
e2cfc911 64{
e2cfc911 65}
d435edca
VB
66static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
67{
68}
7cd12b4a
VB
69static inline void set_page_owner_migrate_reason(struct page *page, int reason)
70{
71}
4e462112
VB
72static inline void dump_page_owner(struct page *page)
73{
74}
48c96a36
JK
75#endif /* CONFIG_PAGE_OWNER */
76#endif /* __LINUX_PAGE_OWNER_H */