void-packages/srcpkgs/linux5.10/patches/page-poison-fix.patch
q66 5969ed3728 linux5.10: unbreak page poisoning
also fix ppc dotconfigs
2021-01-25 14:56:00 +01:00

58 lines
1.6 KiB
Diff

This breaks page poisoning on some architectures. The commit is not
very useful by itself, so revert it until a real fix is upstream.
From 0cbb20875a8607653f02d799fd4b75a34d1b6636 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Mon, 25 Jan 2021 02:59:47 +0100
Subject: [PATCH] Revert "mm/page_poison.c: replace bool variable with static
key"
This reverts commit 11c9c7edae06da789abfdeefe5123162a3f1c7dc.
---
mm/page_poison.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/mm/page_poison.c b/mm/page_poison.c
index ae0482c..34b9181 100644
--- a/mm/page_poison.c
+++ b/mm/page_poison.c
@@ -8,23 +8,13 @@
#include <linux/ratelimit.h>
#include <linux/kasan.h>
-static DEFINE_STATIC_KEY_FALSE_RO(want_page_poisoning);
+static bool want_page_poisoning __read_mostly;
static int __init early_page_poison_param(char *buf)
{
- int ret;
- bool tmp;
-
- ret = strtobool(buf, &tmp);
- if (ret)
- return ret;
-
- if (tmp)
- static_branch_enable(&want_page_poisoning);
- else
- static_branch_disable(&want_page_poisoning);
-
- return 0;
+ if (!buf)
+ return -EINVAL;
+ return strtobool(buf, &want_page_poisoning);
}
early_param("page_poison", early_page_poison_param);
@@ -41,7 +31,7 @@ bool page_poisoning_enabled(void)
* Page poisoning is debug page alloc for some arches. If
* either of those options are enabled, enable poisoning.
*/
- return (static_branch_unlikely(&want_page_poisoning) ||
+ return (want_page_poisoning ||
(!IS_ENABLED(CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC) &&
debug_pagealloc_enabled()));
}
--
2.30.0