Skip to content
Commit 749630ce authored by Oscar Salvador's avatar Oscar Salvador Committed by Greg Kroah-Hartman
Browse files

mm,hwpoison: refactor get_any_page

[ Upstream commit 8295d535 ]

Patch series "HWPoison: Refactor get page interface", v2.

This patch (of 3):

When we want to grab a refcount via get_any_page, we call __get_any_page
that calls get_hwpoison_page to get the actual refcount.

get_any_page() is only there because we have a sort of retry mechanism in
case the page we met is unknown to us or if we raced with an allocation.

Also __get_any_page() prints some messages about the page type in case the
page was a free page or the page type was unknown, but if anything, we
only need to print a message in case the pagetype was unknown, as that is
reporting an error down the chain.

Let us merge get_any_page() and __get_any_page(), and let the message be
printed in soft_offline_page.  While we are it, we can also remove the
'pfn' parameter as it is no longer used.

Link: https://lkml.kernel.org/r/20201204102558.31607-1-osalvador@suse.de
Link: https://lkml.kernel.org/r/20201204102558.31607-2-osalvador@suse.de


Signed-off-by: default avatarOscar Salvador <osalvador@suse.de>
Acked-by: default avatarNaoya Horiguchi <naoya.horiguchi@nec.com>
Acked-by: default avatarVlastimil Babka <Vbabka@suse.cz>
Cc: Qian Cai <qcai@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Stable-dep-of: e2c1ab07 ("mm: memory-failure: fix unexpected return value in soft_offline_page()")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 0df5eaab
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment