From patchwork Thu Aug 6 18:49:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11704105 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 89E0C913 for ; Thu, 6 Aug 2020 18:50:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B2F6E2224D for ; Thu, 6 Aug 2020 18:50:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cV2AEwHE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B2F6E2224D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1C9786B0023; Thu, 6 Aug 2020 14:50:06 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 153036B0024; Thu, 6 Aug 2020 14:50:06 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F34BC6B0025; Thu, 6 Aug 2020 14:50:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0182.hostedemail.com [216.40.44.182]) by kanga.kvack.org (Postfix) with ESMTP id DDBE56B0023 for ; Thu, 6 Aug 2020 14:50:05 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A7E9F3623 for ; Thu, 6 Aug 2020 18:50:05 +0000 (UTC) X-FDA: 77121033570.19.spy63_4b109b426fb9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 6BDA71AD1B1 for ; Thu, 6 Aug 2020 18:50:05 +0000 (UTC) X-Spam-Summary: 1,0,0,e5881346811ac187,d41d8cd98f00b204,nao.horiguchi@gmail.com,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1345:1359:1437:1535:1543:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2899:3138:3139:3140:3141:3142:3353:3867:3871:3872:3874:4117:4250:4321:4385:4605:5007:6261:6653:6742:7576:8660:8957:9413:10004:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12679:12740:12895:13148:13230:14093:14181:14394:14721:21060:21080:21094:21212:21323:21324:21444:21627:21666:21939:21990:22119:30054,0,RBL:209.85.216.66:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yfi9e5h3sfdhaj1yi5s1irmrfcrycoa4ndhgoh9mb5acijhfn45kj73tpwnqy.afzw44egmck9mj3f1frwgfm4fe6wywczasiawkcujrphg9iqat3yiq415qx6q6j.a-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: spy63_4b109b426fb9 X-Filterd-Recvd-Size: 6057 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Aug 2020 18:50:04 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id c10so5101360pjn.1 for ; Thu, 06 Aug 2020 11:50:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wKkzBXT0A10RMCbmB0sW63A088296XpG9JqckPfziyY=; b=cV2AEwHEAACGSXDXztNlukjitDsQ3Yhfl3T+j5IzNo3aIvL1oYcU54iT2oEJquFGYV EFBO96h6xam0Fho+vRGKCvi0UApaak6sY21ukTsnFDNxC5n163cegZEZtIlGZt9ADWXY x1jx3cmHjERpUV5jKT49VqwepH2d0nTzLPqNH9EiMw3XHNodLfouk0OdFcm4lJ2q0vxx P4mlUuHFaaESzW4bzE/plwmxA60SXFWaxC6KM+q+ogLtrWlrUOD4ArcGvQLSWrfCdBRs 1xyTzT/988nMi1UtYJTeMMyIKYy2ty5ssvT/mHrA8FJm+ndItPFfGIkv16Je8NCHXJDf 88iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wKkzBXT0A10RMCbmB0sW63A088296XpG9JqckPfziyY=; b=McNY/oBzgcqUWVp93483/nvVYE103PsEgxjjHLutFB0ywCE1GepeBLhdYJfUl63+xg R5WLzBwoD0Ro1ePwOOdCx+g06V18/cA06ZjJz2uCdDoSdASWe2FXS1PJNBztZuwf8LMP hRmTmG6MFN8Y2lvzuNm2lcofNr98Ydc8/0kO9vo9vbfWAGnm0q06rUlbOcFlX6aSYV0g NJIbaonJ6thU5di72APjPSUyfqSZU1dXJLNZpDS1uXahdUMiXpP8eYKtMskZYpbvHK11 1sc0K4dQ2ZqCbB7NpKvH1IAUArQq5rZ1JpOSXWsldEpOVMJq9Fzjxich4SfFEhH7TBRw iU+g== X-Gm-Message-State: AOAM5330c9Ma39W/Zq8fCRG6aw79F3+PGxUvXFfaY3sBSHje77vC8H3M aGF4WbAdN1iKlbSM19ZqiI0/rFkVeQ== X-Google-Smtp-Source: ABdhPJwRcKOgv9ZvObyRfMqP+tKa5UG/Urcd5pPbv+ymwa+u3QTNFnkHaQoxC5Mx95UOdPkgbcas5A== X-Received: by 2002:a17:90b:684:: with SMTP id m4mr9827210pjz.4.1596739803868; Thu, 06 Aug 2020 11:50:03 -0700 (PDT) Received: from ip-172-31-41-194.ap-northeast-1.compute.internal (ec2-52-199-21-241.ap-northeast-1.compute.amazonaws.com. [52.199.21.241]) by smtp.gmail.com with ESMTPSA id u24sm9096730pfm.20.2020.08.06.11.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 11:50:03 -0700 (PDT) From: nao.horiguchi@gmail.com To: linux-mm@kvack.org Cc: mhocko@kernel.org, akpm@linux-foundation.org, mike.kravetz@oracle.com, osalvador@suse.de, tony.luck@intel.com, david@redhat.com, aneesh.kumar@linux.vnet.ibm.com, zeil@yandex-team.ru, cai@lca.pw, naoya.horiguchi@nec.com, linux-kernel@vger.kernel.org Subject: [PATCH v6 11/12] mm,hwpoison: introduce MF_MSG_UNSPLIT_THP Date: Thu, 6 Aug 2020 18:49:22 +0000 Message-Id: <20200806184923.7007-12-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806184923.7007-1-nao.horiguchi@gmail.com> References: <20200806184923.7007-1-nao.horiguchi@gmail.com> X-Rspamd-Queue-Id: 6BDA71AD1B1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: From: Naoya Horiguchi memory_failure() is supposed to call action_result() when it handles a memory error event, but there's one missing case. So let's add it. I find that include/ras/ras_event.h has some other MF_MSG_* undefined, so this patch also adds them. Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador --- include/linux/mm.h | 1 + include/ras/ras_event.h | 3 +++ mm/memory-failure.c | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git v5.8-rc7-mmotm-2020-07-27-18-18/include/linux/mm.h v5.8-rc7-mmotm-2020-07-27-18-18_patched/include/linux/mm.h index 371970dfffc4..442921a004a2 100644 --- v5.8-rc7-mmotm-2020-07-27-18-18/include/linux/mm.h +++ v5.8-rc7-mmotm-2020-07-27-18-18_patched/include/linux/mm.h @@ -3024,6 +3024,7 @@ enum mf_action_page_type { MF_MSG_BUDDY, MF_MSG_BUDDY_2ND, MF_MSG_DAX, + MF_MSG_UNSPLIT_THP, MF_MSG_UNKNOWN, }; diff --git v5.8-rc7-mmotm-2020-07-27-18-18/include/ras/ras_event.h v5.8-rc7-mmotm-2020-07-27-18-18_patched/include/ras/ras_event.h index 36c5c5e38c1d..0bdbc0d17d2f 100644 --- v5.8-rc7-mmotm-2020-07-27-18-18/include/ras/ras_event.h +++ v5.8-rc7-mmotm-2020-07-27-18-18_patched/include/ras/ras_event.h @@ -361,6 +361,7 @@ TRACE_EVENT(aer_event, EM ( MF_MSG_POISONED_HUGE, "huge page already hardware poisoned" ) \ EM ( MF_MSG_HUGE, "huge 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" ) \ EM ( MF_MSG_DIRTY_SWAPCACHE, "dirty swapcache page" ) \ EM ( MF_MSG_CLEAN_SWAPCACHE, "clean swapcache page" ) \ @@ -373,6 +374,8 @@ TRACE_EVENT(aer_event, EM ( MF_MSG_TRUNCATED_LRU, "already truncated LRU page" ) \ EM ( MF_MSG_BUDDY, "free buddy page" ) \ EM ( MF_MSG_BUDDY_2ND, "free buddy page (2nd try)" ) \ + EM ( MF_MSG_DAX, "dax page" ) \ + EM ( MF_MSG_UNSPLIT_THP, "unsplit thp" ) \ EMe ( MF_MSG_UNKNOWN, "unknown page" ) /* diff --git v5.8-rc7-mmotm-2020-07-27-18-18/mm/memory-failure.c v5.8-rc7-mmotm-2020-07-27-18-18_patched/mm/memory-failure.c index 61e20b7dd81c..bed4b6aac9a0 100644 --- v5.8-rc7-mmotm-2020-07-27-18-18/mm/memory-failure.c +++ v5.8-rc7-mmotm-2020-07-27-18-18_patched/mm/memory-failure.c @@ -583,6 +583,7 @@ static const char * const action_page_types[] = { [MF_MSG_BUDDY] = "free buddy page", [MF_MSG_BUDDY_2ND] = "free buddy page (2nd try)", [MF_MSG_DAX] = "dax page", + [MF_MSG_UNSPLIT_THP] = "unsplit thp", [MF_MSG_UNKNOWN] = "unknown page", }; @@ -1373,8 +1374,10 @@ int memory_failure(unsigned long pfn, int flags) } if (PageTransHuge(hpage)) { - if (try_to_split_thp_page(p, "Memory Failure") < 0) + if (try_to_split_thp_page(p, "Memory Failure") < 0) { + action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED); return -EBUSY; + } VM_BUG_ON_PAGE(!page_count(p), p); }