summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJane Chu <jane.chu@oracle.com>2024-05-01 17:24:57 -0600
committerAndrew Morton <akpm@linux-foundation.org>2024-05-07 11:29:48 -0700
commite5b36783c6277d91e91380a971374b79f8162e9e (patch)
treea004fc59b4463d465539e60a650a6ddee4c61847
parentd69c5a07dc2c755110f675763745c18fe937edb7 (diff)
mm/madvise: add MF_ACTION_REQUIRED to madvise(MADV_HWPOISON)
The soft hwpoison injector via madvise(MADV_HWPOISON) operates in a synchrous way in a sense, the injector is also a process under test, and should it have the poisoned page mapped in its address space, it should legitimately get killed as much as in a real UE situation. Link: https://lkml.kernel.org/r/20240501232458.3919593-3-jane.chu@oracle.com Signed-off-by: Jane Chu <jane.chu@oracle.com> Cc: Miaohe Lin <linmiaohe@huawei.com> Cc: Naoya Horiguchi <nao.horiguchi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--mm/madvise.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index a77893462b92..96c026fe0c99 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -1147,7 +1147,7 @@ static int madvise_inject_error(int behavior,
} else {
pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n",
pfn, start);
- ret = memory_failure(pfn, MF_COUNT_INCREASED | MF_SW_SIMULATED);
+ ret = memory_failure(pfn, MF_ACTION_REQUIRED | MF_COUNT_INCREASED | MF_SW_SIMULATED);
if (ret == -EOPNOTSUPP)
ret = 0;
}