From patchwork Fri Jul 31 12:21:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11694855 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 1E5FB1392 for ; Fri, 31 Jul 2020 12:22:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DF9A022D3E for ; Fri, 31 Jul 2020 12:22:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JH0YS43k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF9A022D3E 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 714118D004C; Fri, 31 Jul 2020 08:22:06 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 69F668D004B; Fri, 31 Jul 2020 08:22: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 56A4D8D004C; Fri, 31 Jul 2020 08:22:06 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0027.hostedemail.com [216.40.44.27]) by kanga.kvack.org (Postfix) with ESMTP id 3A6EC8D004B for ; Fri, 31 Jul 2020 08:22:06 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 01D528248047 for ; Fri, 31 Jul 2020 12:22:06 +0000 (UTC) X-FDA: 77098283052.25.mine37_580097e26f83 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin25.hostedemail.com (Postfix) with ESMTP id C904E1804E3A1 for ; Fri, 31 Jul 2020 12:22:05 +0000 (UTC) X-Spam-Summary: 1,0,0,3a459b1130f16d48,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.65:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04ygfdzo4xjd77ghnp1pmrafryndpycoa4ndhgoh9mb5acijhfn45kj73tpwnqy.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: mine37_580097e26f83 X-Filterd-Recvd-Size: 6063 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 12:22:05 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id e22so7655985pjt.3 for ; Fri, 31 Jul 2020 05:22:05 -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=DeQp8qeoPbySHXWwwb0orjOK+38VoyYyRVxT40RVsgA=; b=JH0YS43kMG6lFBe3wbbXVA15iWByJHoFD+/phhTMfrNmROe8y/ANMlG9BW6mVewofq 19uCSvVxVUC1JOxMvD6nCVqHq/J0GeqfsQ0jTvtv2mBHRmck4fseevfjtTnBn2OTVqi2 jehg04UOdaFl7OBA8YPi0UadKkF112L0v/p6TypyL4MG+P9928qmJxa1t+wbs5iWZP8K DuXNuvXkG0pwHYtkhD6kak4x8nsBXiS3ly9eX1E2r5gZmI4i28R0hSOmjkB6wTRZkl7i 6lBgPKg+a53bdGyt0FmFZ7ZTHzDpkYIgZwEfx2dTqJxgqFDFVjsb9K3rFEe9pZEclSRt F2Nw== 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=DeQp8qeoPbySHXWwwb0orjOK+38VoyYyRVxT40RVsgA=; b=a4psqbMKXc1zum67acAXDCvFa/3LHGqRwujyepsSmOkoWNjbKLoGgrPR3yGD/4M/br WwUPlU5Zu0jj4kxXWtLm0BVtoQEFu5cb5kFbDgfBotM49Shvs2chG1DhCW0wWXgIPMCA axzxobizDMMjzhkdBGzJUDyYEEaQDiPxKW9z323PrDdlenxBDnTRrJcGnl7e/Mo1ax0D OrjrmBOxT4ZalKkzSupfXpEs5jmMsN/YC5/LBY5DGmoFuDaXqNCd6Qe+DvRoGVkprVRy Qsq4OMFqFzVYCAprqaYIZ4AzPsdeBFsyVj8MPXklciIDj4+jfhePuLgZldcGCR1+891l pJOA== X-Gm-Message-State: AOAM532qmI4tc+wOynv18yzZCy5qJcQYCB876/u1jpI7vDRDzclEIn53 W8d1HDX38xWAPDdZbXlGjV10ZQa+fw== X-Google-Smtp-Source: ABdhPJxCuhOPlrzcVhXzPFCZw2q0er+jAX8DvkrMnB02bNmSP9JC8tnUAqk7NPyCj/LrVkCYpYd0VQ== X-Received: by 2002:a17:90a:3fc7:: with SMTP id u7mr3784062pjm.231.1596198124242; Fri, 31 Jul 2020 05:22:04 -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 m19sm3675692pjv.34.2020.07.31.05.22.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:22: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 v5 15/16] mm,hwpoison: introduce MF_MSG_UNSPLIT_THP Date: Fri, 31 Jul 2020 12:21:11 +0000 Message-Id: <20200731122112.11263-16-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200731122112.11263-1-nao.horiguchi@gmail.com> References: <20200731122112.11263-1-nao.horiguchi@gmail.com> X-Rspamd-Queue-Id: C904E1804E3A1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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 ecb3c7191fb7..4f12b2465e80 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 @@ -3023,6 +3023,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 bd63f1f2e44e..6f242a194c64 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); }