hulk inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/8489 -------------------------------- This reverts commit 6c86fa23cd7eeda91654934e755a752b0149dfb5. Commit 6c86fa23cd7e ("mm/memory-failure: support disabling soft offline for HugeTLB pages") introduced a new bit of sysctl_enable_soft_offline to support disabling soft offline for HugeTLB pages only. It is no longer needed. Let's revert it. Signed-off-by: Qi Xi <xiqi2@huawei.com> --- .../ABI/testing/sysfs-memory-page-offline | 3 --- kernel/sysctl.c | 2 +- mm/memory-failure.c | 16 ++-------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/Documentation/ABI/testing/sysfs-memory-page-offline b/Documentation/ABI/testing/sysfs-memory-page-offline index 93285bbadc9e..e14703f12fdf 100644 --- a/Documentation/ABI/testing/sysfs-memory-page-offline +++ b/Documentation/ABI/testing/sysfs-memory-page-offline @@ -20,9 +20,6 @@ Description: number, or a error when the offlining failed. Reading the file is not allowed. - Soft-offline can be controlled via sysctl, see: - Documentation/admin-guide/sysctl/vm.rst - What: /sys/devices/system/memory/hard_offline_page Date: Sep 2009 KernelVersion: 2.6.33 diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 88f92eff7bf2..f35a1990456e 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1831,7 +1831,7 @@ static struct ctl_table vm_table[] = { .mode = 0644, .proc_handler = proc_dointvec_minmax, .extra1 = &zero, - .extra2 = &three, + .extra2 = &one, }, #endif { diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 7fbc9c214da9..ad416016d1e9 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -63,14 +63,11 @@ #include "internal.h" #include "ras/ras_event.h" -#define SOFT_OFFLINE_ENABLED BIT(0) -#define SOFT_OFFLINE_SKIP_HUGETLB BIT(1) - int sysctl_memory_failure_early_kill __read_mostly = 0; int sysctl_memory_failure_recovery __read_mostly = 1; -int sysctl_enable_soft_offline __read_mostly = SOFT_OFFLINE_ENABLED; +int sysctl_enable_soft_offline __read_mostly = 1; atomic_long_t num_poisoned_pages __read_mostly = ATOMIC_LONG_INIT(0); @@ -2034,22 +2031,13 @@ int soft_offline_page(struct page *page, int flags) return -EIO; } - if (!(sysctl_enable_soft_offline & SOFT_OFFLINE_ENABLED)) { + if (!sysctl_enable_soft_offline) { pr_info_once("disabled by /proc/sys/vm/enable_soft_offline\n"); if (flags & MF_COUNT_INCREASED) put_page(page); return -EOPNOTSUPP; } - if (sysctl_enable_soft_offline & SOFT_OFFLINE_SKIP_HUGETLB) { - if (PageHuge(page)) { - pr_info_once("disabled for HugeTLB pages by /proc/sys/vm/enable_soft_offline\n"); - if (flags & MF_COUNT_INCREASED) - put_page(page); - return -EOPNOTSUPP; - } - } - if (PageHWPoison(page)) { pr_info("soft offline: %#lx page already poisoned\n", pfn); if (flags & MF_COUNT_INCREASED) -- 2.33.0