|
@@ -2061,7 +2061,22 @@ static inline void vm_stat_account(struct mm_struct *mm,
|
|
|
#endif /* CONFIG_PROC_FS */
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_PAGEALLOC
|
|
|
-extern void kernel_map_pages(struct page *page, int numpages, int enable);
|
|
|
+extern bool _debug_pagealloc_enabled;
|
|
|
+extern void __kernel_map_pages(struct page *page, int numpages, int enable);
|
|
|
+
|
|
|
+static inline bool debug_pagealloc_enabled(void)
|
|
|
+{
|
|
|
+ return _debug_pagealloc_enabled;
|
|
|
+}
|
|
|
+
|
|
|
+static inline void
|
|
|
+kernel_map_pages(struct page *page, int numpages, int enable)
|
|
|
+{
|
|
|
+ if (!debug_pagealloc_enabled())
|
|
|
+ return;
|
|
|
+
|
|
|
+ __kernel_map_pages(page, numpages, enable);
|
|
|
+}
|
|
|
#ifdef CONFIG_HIBERNATION
|
|
|
extern bool kernel_page_present(struct page *page);
|
|
|
#endif /* CONFIG_HIBERNATION */
|