From patchwork Mon Apr 25 08:03:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12825365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30626C433EF for ; Mon, 25 Apr 2022 08:02:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7D6B8D0016; Mon, 25 Apr 2022 04:02:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C05708D0006; Mon, 25 Apr 2022 04:02:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ACDDE8D0016; Mon, 25 Apr 2022 04:02:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 82BEF8D0006 for ; Mon, 25 Apr 2022 04:02:28 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 64B14121F40 for ; Mon, 25 Apr 2022 08:02:28 +0000 (UTC) X-FDA: 79394659176.28.6E91F04 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf08.hostedemail.com (Postfix) with ESMTP id 2F777160002 for ; Mon, 25 Apr 2022 08:02:23 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D5C501FB; Mon, 25 Apr 2022 01:02:26 -0700 (PDT) Received: from a077893.arm.com (unknown [10.163.40.250]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 0A9293F73B; Mon, 25 Apr 2022 01:02:21 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org Cc: Anshuman Khandual , Andrew Morton , Tony Luck , Borislav Petkov , Naoya Horiguchi , 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 Message-Id: <20220425080306.1771480-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Stat-Signature: 9yk9jjdx1ud5d6hm4639a74dddqkmjpw X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2F777160002 X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com; dmarc=pass (policy=none) header.from=arm.com X-HE-Tag: 1650873743-835199 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Cc: Tony Luck Cc: Borislav Petkov Cc: Naoya Horiguchi Cc: linux-mm@kvack.org Cc: linux-edac@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- 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; }