From: Miaohe Lin <linmiaohe@huawei.com>
To: <akpm@linux-foundation.org>, <naoya.horiguchi@nec.com>
Cc: <willy@infradead.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <linmiaohe@huawei.com>
Subject: [PATCH v2 4/4] mm: memory-failure: add PageOffline() check
Date: Thu, 27 Jul 2023 19:56:43 +0800 [thread overview]
Message-ID: <20230727115643.639741-5-linmiaohe@huawei.com> (raw)
In-Reply-To: <20230727115643.639741-1-linmiaohe@huawei.com>
Memory failure is not interested in logically offlined page. Skip this
type of pages.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
---
mm/memory-failure.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index d975a6b224f7..e4c4b9dc852f 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1561,7 +1561,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
* Here we are interested only in user-mapped pages, so skip any
* other types of pages.
*/
- if (PageReserved(p) || PageSlab(p) || PageTable(p))
+ if (PageReserved(p) || PageSlab(p) || PageTable(p) || PageOffline(p))
return true;
if (!(PageLRU(hpage) || PageHuge(p)))
return true;
@@ -2535,7 +2535,8 @@ int unpoison_memory(unsigned long pfn)
goto unlock_mutex;
}
- if (folio_test_slab(folio) || PageTable(&folio->page) || folio_test_reserved(folio))
+ if (folio_test_slab(folio) || PageTable(&folio->page) ||
+ folio_test_reserved(folio) || PageOffline(&folio->page))
goto unlock_mutex;
/*
--
2.33.0
next prev parent reply other threads:[~2023-07-27 11:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 11:56 [PATCH v2 0/4] A few fixup patches for mm Miaohe Lin
2023-07-27 11:56 ` [PATCH v2 1/4] mm/swapfile: fix wrong swap entry type for hwpoisoned swapcache page Miaohe Lin
2023-07-27 11:56 ` [PATCH v2 2/4] mm: memory-failure: fix potential unexpected return value from unpoison_memory() Miaohe Lin
2023-07-27 11:56 ` [PATCH v2 3/4] mm: memory-failure: avoid false hwpoison page mapped error info Miaohe Lin
2023-07-27 11:56 ` Miaohe Lin [this message]
2023-07-27 16:57 ` [PATCH v2 0/4] A few fixup patches for mm Andrew Morton
2023-07-28 2:20 ` Miaohe Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230727115643.639741-5-linmiaohe@huawei.com \
--to=linmiaohe@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=naoya.horiguchi@nec.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®