From 1b7f4f070910850fcb37fc686830c4d092aaa069 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Mon, 27 Aug 2018 09:32:18 +0800 Subject: [PATCH 0852/2944] mm/page_poison: expose page_poisoning_enabled to kernel modules to #26589565 commit d95f58f4a6ca002126c36c530fb096519c94baef upstream In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang Cc: Andrew Morton Cc: Michal Hocko Cc: Michael S. Tsirkin Acked-by: Andrew Morton Signed-off-by: Michael S. Tsirkin Signed-off-by: Yang Shi Reviewed-by: Xunlei Pang Signed-off-by: Shile Zhang --- mm/page_poison.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/page_poison.c b/mm/page_poison.c index 6cfa8e7..1f362e6 100644 --- a/mm/page_poison.c +++ b/mm/page_poison.c @@ -18,6 +18,11 @@ static int __init early_page_poison_param(char *buf) } early_param("page_poison", early_page_poison_param); +/** + * page_poisoning_enabled - check if page poisoning is enabled + * + * Return true if page poisoning is enabled, or false if not. + */ bool page_poisoning_enabled(void) { /* @@ -30,6 +35,7 @@ bool page_poisoning_enabled(void) (!IS_ENABLED(CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC) && debug_pagealloc_enabled())); } +EXPORT_SYMBOL_GPL(page_poisoning_enabled); static void poison_page(struct page *page) { -- 1.8.3.1