提交 209a5f19 编写于 作者: L Liu Shixin 提交者: Zheng Zengkai

mm: hwpoison: enable memory error handling on 1GB hugepage optionaly

hulk inclusion
category: feature
bugzilla: 186704, https://gitee.com/openeuler/kernel/issues/I58V3W
CVE: NA

--------------------------------

The memory error handling on 1GB hugepage is disabled by commit 31286a84
because it may lead to a kernel panic.

However, the commit will result a more troublesome downstream problem. So we
have to revert it in some situation. At the same time, we backport commit
15494520 which resolve the kernel panic described in commit 31286a84.

We add a new cmdline named 'hugetlb_hwpoison_full' to enable memory error
handling on 1GB hugepage. By default, the memory error handling on 1GB hugepage
is disabled.

Note that the kernel panic may not have been completely resolved!
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 782a6ba7
......@@ -1613,6 +1613,9 @@
off: Disable the feature
Equivalent to: nohugevmalloc
hugetlb_hwpoison_full
[HW] Enable memory error handling of 1GB hugepage.
hung_task_panic=
[KNL] Should the hung task detector generate panics.
Format: 0 | 1
......
......@@ -1148,6 +1148,15 @@ static int try_to_split_thp_page(struct page *page, const char *msg)
return 0;
}
static bool hugetlb_hwpoison_full;
static int __init enable_hugetlb_hwpoison_full(char *str)
{
hugetlb_hwpoison_full = true;
return 0;
}
early_param("hugetlb_hwpoison_full", enable_hugetlb_hwpoison_full);
static int memory_failure_hugetlb(unsigned long pfn, int flags)
{
struct page *p = pfn_to_page(pfn);
......@@ -1197,7 +1206,8 @@ static int memory_failure_hugetlb(unsigned long pfn, int flags)
* - other mm code walking over page table is aware of pud-aligned
* hwpoison entries.
*/
if (huge_page_size(page_hstate(head)) > PMD_SIZE) {
if (!hugetlb_hwpoison_full &&
huge_page_size(page_hstate(head)) > PMD_SIZE) {
action_result(pfn, MF_MSG_NON_PMD_HUGE, MF_IGNORED);
res = -EBUSY;
goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册