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.
Ma Wupeng (3): mm/hwpoison: Export symbol soft_offline_page mm: page_eject: Introuduce page ejection config: update defconfig for PAGE_EJECT
arch/arm64/configs/openeuler_defconfig | 1 + arch/x86/configs/openeuler_defconfig | 1 + drivers/ras/Kconfig | 10 + drivers/ras/Makefile | 1 + drivers/ras/page_eject.c | 248 +++++++++++++++++++++++++ mm/memory-failure.c | 1 + 6 files changed, 262 insertions(+) create mode 100644 drivers/ras/page_eject.c