mm/memory-failure.c: rework the try_to_unmap logic in hwpoison_user_mappings()
authorMiaohe Lin <linmiaohe@huawei.com>
Mon, 28 Feb 2022 23:01:10 +0000 (10:01 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 23:01:10 +0000 (10:01 +1100)
commit1d24340dd3980bcd2ca2491f6526bd418a5f3d57
tree65f129a76263712802078c114dcf22f5bbc99bde
parentd4df061d74bde6b0ea67f331e63f49ef5d4d239c
mm/memory-failure.c: rework the try_to_unmap logic in hwpoison_user_mappings()

Only for hugetlb pages in shared mappings, try_to_unmap should take
semaphore in write mode here.  Rework the code to make it clear.

Link: https://lkml.kernel.org/r/20220218090118.1105-7-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