mm/memory-failure: check the mapcount of the precise page
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 18 Dec 2023 13:58:36 +0000 (13:58 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 20 Dec 2023 21:46:19 +0000 (13:46 -0800)
commitc79c5a0a00a9457718056b588f312baadf44e471
treeb246412880944c3258f1149206f824f28a26efbc
parent376907f3a0b34a17e80417825f8cc1c40fcba81b
mm/memory-failure: check the mapcount of the precise page

A process may map only some of the pages in a folio, and might be missed
if it maps the poisoned page but not the head page.  Or it might be
unnecessarily hit if it maps the head page, but not the poisoned page.

Link: https://lkml.kernel.org/r/20231218135837.3310403-3-willy@infradead.org
Fixes: 7af446a841a2 ("HWPOISON, hugetlb: enable error handling path for hugepage")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c