Re: [RFC v3 PATCH 0/5] Solve silent data loss caused by poisoned page cache (shmem/tmpfs)

From: Peter Xu
Date: Tue Oct 12 2021 - 22:41:13 EST


On Thu, Sep 30, 2021 at 02:53:06PM -0700, Yang Shi wrote:
> Yang Shi (5):
> mm: hwpoison: remove the unnecessary THP check
> mm: filemap: check if THP has hwpoisoned subpage for PMD page fault
> mm: hwpoison: refactor refcount check handling
> mm: shmem: don't truncate page if memory failure happens
> mm: hwpoison: handle non-anonymous THP correctly

Today I just noticed one more thing: unpoison path has (unpoison_memory):

if (page_mapping(page)) {
unpoison_pr_info("Unpoison: the hwpoison page has non-NULL mapping %#lx\n",
pfn, &unpoison_rs);
return 0;
}

I _think_ it was used to make sure we ignore page that was not successfully
poisoned/offlined before (for anonymous), so raising this question up on
whether we should make sure e.g. shmem hwpoisoned pages still can be unpoisoned
for debugging purposes.

--
Peter Xu