]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/hwpoison: retry with shake_page() for unhandlable pages
authorNaoya Horiguchi <naoya.horiguchi@nec.com>
Fri, 20 Aug 2021 02:04:24 +0000 (19:04 -0700)
committerSasha Levin <sashal@kernel.org>
Thu, 26 Aug 2021 12:35:18 +0000 (08:35 -0400)
commit9690e6ffac0b1a8bf865097de7d195ef6870b8f4
tree47083fa93710ecea468353260b3b8b8e40503ed3
parent59e5c9ecdeb0919ff8490ff9aeb7f6dc2dbef982
mm/hwpoison: retry with shake_page() for unhandlable pages

[ Upstream commit fcc00621d88b274b5dffd8daeea71d0e4c28b84e ]

HWPoisonHandlable() sometimes returns false for typical user pages due
to races with average memory events like transfers over LRU lists.  This
causes failures in hwpoison handling.

There's retry code for such a case but does not work because the retry
loop reaches the retry limit too quickly before the page settles down to
handlable state.  Let get_any_page() call shake_page() to fix it.

[naoya.horiguchi@nec.com: get_any_page(): return -EIO when retry limit reached]
Link: https://lkml.kernel.org/r/20210819001958.2365157-1-naoya.horiguchi@linux.dev
Link: https://lkml.kernel.org/r/20210817053703.2267588-1-naoya.horiguchi@linux.dev
Fixes: 25182f05ffed ("mm,hwpoison: fix race with hugetlb page allocation")
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Reported-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: <stable@vger.kernel.org> [5.13+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
mm/memory-failure.c