From: Ma Wupeng mawupeng1@huawei.com
Page ejection is achieved by soft_offline_page and unpoison_memory. A linked list is maintained to log the pfns which are offlined by this module. Only the pfns present in the list is allowed to go online.
The follow sysfs is introduced to online/offline page via this module, since there is a internal linked list to record all offlined pages, remove_page is introduce to remove this page from list.
- /sys/kernel/page_eject/online_page - /sys/kernel/page_eject/offline_page - /sys/kernel/page_eject/remove_page
Besides pag eject, machine check safe is enhanced as follow:
During soft offline page, page is copied to new page in kernel. If the origin page has UCE, there will lead to kernel panic.
In order to solve this problem, use machine check safe to catch this error which can be achieved by using copy_mc_to_kernel to replace copy_page. Signal SIGBUS will be send to user task if this UCE is consumed by this situation to avoid kernel panic.
Jiaqi Yan (1): mm/hwpoison: introduce copy_mc_highpage
Ma Wupeng (6): mm: introduce copy_mc_highpages mm: arm64: Add migrate_page_copy_mc() mm: Update PF_COREDUMP_MCS to PF_MCS mm/hwpoison: Export symbol soft_offline_page mm: page_eject: Introuduce page ejection mm: page_eject: Add mc support during offline page
drivers/ras/Kconfig | 10 ++ drivers/ras/Makefile | 1 + drivers/ras/page_eject.c | 249 +++++++++++++++++++++++++++++++++++++++ fs/coredump.c | 4 +- include/linux/highmem.h | 49 ++++++++ include/linux/sched.h | 2 +- lib/iov_iter.c | 2 +- mm/memory-failure.c | 1 + mm/migrate.c | 63 ++++++++-- 9 files changed, 365 insertions(+), 16 deletions(-) create mode 100644 drivers/ras/page_eject.c