0001
0002 #ifndef _MM_PAGE_REPORTING_H
0003 #define _MM_PAGE_REPORTING_H
0004
0005 #include <linux/mmzone.h>
0006 #include <linux/pageblock-flags.h>
0007 #include <linux/page-isolation.h>
0008 #include <linux/jump_label.h>
0009 #include <linux/slab.h>
0010 #include <linux/pgtable.h>
0011 #include <linux/scatterlist.h>
0012
0013 #ifdef CONFIG_PAGE_REPORTING
0014 DECLARE_STATIC_KEY_FALSE(page_reporting_enabled);
0015 extern unsigned int page_reporting_order;
0016 void __page_reporting_notify(void);
0017
0018 static inline bool page_reported(struct page *page)
0019 {
0020 return static_branch_unlikely(&page_reporting_enabled) &&
0021 PageReported(page);
0022 }
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 static inline void page_reporting_notify_free(unsigned int order)
0034 {
0035
0036 if (!static_branch_unlikely(&page_reporting_enabled))
0037 return;
0038
0039
0040 if (order < page_reporting_order)
0041 return;
0042
0043
0044 __page_reporting_notify();
0045 }
0046 #else
0047 #define page_reported(_page) false
0048
0049 static inline void page_reporting_notify_free(unsigned int order)
0050 {
0051 }
0052 #endif
0053 #endif