mm/memory-failure.c: rework the try_to_unmap logic in hwpoison_user_mappings()
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 22 Mar 2022 21:44:27 +0000 (14:44 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:07 +0000 (15:57 -0700)
commit357670f79efb7e520461d18bb093342605c7cbed
tree01dfe7f4a93d489de74970be3cb1db7a64bcbddc
parent67ff51c6a6d2ef99cf35a937e59269dc9a0c7fc2
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: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory-failure.c