hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8Q58S CVE: NA
---------------------------------
In some ascend sceneraios, we need to get the task regradless of whether it has signal handling functions.
Signed-off-by: Zhang Zekun zhangzekun11@huawei.com --- include/linux/mm.h | 4 ++++ mm/Kconfig | 9 +++++++++ mm/memory-failure.c | 5 +++++ 3 files changed, 18 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h index 80bacc4da324..4e482ff01d38 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -395,6 +395,10 @@ extern unsigned int kobjsize(const void *objp); # define VM_SHARE_POOL VM_NONE #endif
+#if defined(CONFIG_ASCEND_RAS_FEATURES) +#define ASCEND_HWPOISON_MAGIC_NUM 0xABAB +#endif + #ifndef VM_GROWSUP # define VM_GROWSUP VM_NONE #endif diff --git a/mm/Kconfig b/mm/Kconfig index ff0c36f42ca8..65855eaf945e 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -1323,6 +1323,15 @@ config ASCEND_OOM 0: disable oom killer 1: enable oom killer (default,compatible with mainline)
+config ASCEND_RAS_FEATURES + bool "ACPI RAS features for ascend scenarios" + default n + depends on ACPI && ARM64 + help + ACPI RAS features developed to support some of special cases in ascend + scenarios. If you don't know the actual usage of these features don't + open this config. + source "mm/damon/Kconfig"
endmenu diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 4d6e43c88489..228700bb5cb4 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -582,6 +582,11 @@ struct task_struct *task_early_kill(struct task_struct *tsk, int force_early) { if (!tsk->mm) return NULL; + +#ifdef CONFIG_ASCEND_RAS_FEATURES + if (force_early == ASCEND_HWPOISON_MAGIC_NUM) + return tsk; +#endif /* * Comparing ->mm here because current task might represent * a subthread, while tsk always points to the main thread.