Commit 0d0fa7b8 authored by Oscar Salvador's avatar Oscar Salvador Committed by Yang Yingliang
Browse files

mm,hwpoison: rework soft offline for free pages

mainline inclusion
from linux-v5.10-rc1
commit 06be6ff3
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4LE22


CVE: NA

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

When trying to soft-offline a free page, we need to first take it off the
buddy allocator.
Once we know is out of reach, we can safely flag it as poisoned.

take_page_off_buddy will be used to take a page meant to be poisoned off
the buddy allocator. take_page_off_buddy calls break_down_buddy_pages,
which splits a higher-order page in case our page belongs to one.

Once the page is under our control, we call page_handle_poison to set it
as poisoned and grab a refcount on it.

Signed-off-by: default avatarOscar Salvador <osalvador@suse.de>
Acked-by: default avatarNaoya Horiguchi <naoya.horiguchi@nec.com>
Conflicts:
	mm/page_alloc.c
Signed-off-by: default avatarMa Wupeng <mawupeng1@huawei.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent a668355a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment