linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <anshuman.khandual@arm.com>
To: linux-mm@kvack.org
Cc: Anshuman Khandual <anshuman.khandual@arm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
	Naoya Horiguchi <naoya.horiguchi@nec.com>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm/memory-failure: Add new memory failure message MF_MSG_HUGE_ZERO
Date: Mon, 25 Apr 2022 13:33:06 +0530	[thread overview]
Message-ID: <20220425080306.1771480-1-anshuman.khandual@arm.com> (raw)

Memory failure just gets ignored for global huge_zero_page even without a
split attempt. But corresponding memory failure message MF_MSG_UNSPLIT_THP
is misleading as if the THP page could not be split during memory failure
handling. This adds a new message MF_MSG_HUGE_ZERO indicating that memory
got ignored for being a huge zero page.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: linux-mm@kvack.org
Cc: linux-edac@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on v5.18-rc4

 include/linux/mm.h      | 1 +
 include/ras/ras_event.h | 1 +
 mm/memory-failure.c     | 3 ++-
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 9f44254af8ce..a947d87b1ada 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -3236,6 +3236,7 @@ enum mf_action_page_type {
 	MF_MSG_SLAB,
 	MF_MSG_DIFFERENT_COMPOUND,
 	MF_MSG_HUGE,
+	MF_MSG_HUGE_ZERO,
 	MF_MSG_FREE_HUGE,
 	MF_MSG_NON_PMD_HUGE,
 	MF_MSG_UNMAP_FAILED,
diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h
index 1e694fd239b9..feb9eafee966 100644
--- a/include/ras/ras_event.h
+++ b/include/ras/ras_event.h
@@ -359,6 +359,7 @@ TRACE_EVENT(aer_event,
 	EM ( MF_MSG_SLAB, "kernel slab page" )				\
 	EM ( MF_MSG_DIFFERENT_COMPOUND, "different compound page after locking" ) \
 	EM ( MF_MSG_HUGE, "huge page" )					\
+	EM ( MF_MSG_HUGE_ZERO, "huge zero page" )			\
 	EM ( MF_MSG_FREE_HUGE, "free huge page" )			\
 	EM ( MF_MSG_NON_PMD_HUGE, "non-pmd-sized huge page" )		\
 	EM ( MF_MSG_UNMAP_FAILED, "unmapping failed page" )		\
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 27760c19bad7..efe99e8afb73 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -718,6 +718,7 @@ static const char * const action_page_types[] = {
 	[MF_MSG_SLAB]			= "kernel slab page",
 	[MF_MSG_DIFFERENT_COMPOUND]	= "different compound page after locking",
 	[MF_MSG_HUGE]			= "huge page",
+	[MF_MSG_HUGE_ZERO]		= "huge zero page",
 	[MF_MSG_FREE_HUGE]		= "free huge page",
 	[MF_MSG_NON_PMD_HUGE]		= "non-pmd-sized huge page",
 	[MF_MSG_UNMAP_FAILED]		= "unmapping failed page",
@@ -1868,7 +1869,7 @@ int memory_failure(unsigned long pfn, int flags)
 		 * TODO: Handle memory failure of huge_zero_page thoroughly.
 		 */
 		if (is_huge_zero_page(hpage)) {
-			action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED);
+			action_result(pfn, MF_MSG_HUGE_ZERO, MF_IGNORED);
 			res = -EBUSY;
 			goto unlock_mutex;
 		}
-- 
2.20.1



                 reply	other threads:[~2022-04-25  8:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220425080306.1771480-1-anshuman.khandual@arm.com \
    --to=anshuman.khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=naoya.horiguchi@nec.com \
    --cc=tony.luck@intel.com \
    /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