mm/memory-failure.c: fix race with changing page more robustly
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 28 Feb 2022 23:01:08 +0000 (10:01 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 23:01:08 +0000 (10:01 +1100)
commitabafb69c55e5360cdc266197919603b62d4aef6f
tree55f24e3f5b7460c414cfd881a5bc0579111cab20
parente4ea5498fa275e32d2ee16eb1de7f67a875282bf
mm/memory-failure.c: fix race with changing page more robustly

We're only intended to deal with the non-Compound page after we split thp
in memory_failure.  However, the page could have changed compound pages
due to race window.  If this happens, we could retry once to hopefully
handle the page next round.  Also remove unneeded orig_head.  It's always
equal to the hpage.  So we can use hpage directly and remove this
redundant one.

Link: https://lkml.kernel.org/r/20220218090118.1105-5-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
mm/memory-failure.c