From patchwork Fri Jul 31 12:21:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11694841 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 52446913 for ; Fri, 31 Jul 2020 12:21:46 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1F9A62087C for ; Fri, 31 Jul 2020 12:21:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sbKje5uI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F9A62087C 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 D55D18D0033; Fri, 31 Jul 2020 08:21:44 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CDE628D0032; Fri, 31 Jul 2020 08:21:44 -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 BA6438D0033; Fri, 31 Jul 2020 08:21:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 9D9308D0032 for ; Fri, 31 Jul 2020 08:21:44 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5F7DD1EE6 for ; Fri, 31 Jul 2020 12:21:44 +0000 (UTC) X-FDA: 77098282128.03.slope49_6206d9026f83 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 3218428A4E8 for ; Fri, 31 Jul 2020 12:21:44 +0000 (UTC) X-Spam-Summary: 1,0,0,110ae42838dec666,d41d8cd98f00b204,nao.horiguchi@gmail.com,,RULES_HIT:41:69:355:379:541:800:960:966:968:973:988:989:1260:1345:1359:1437:1535:1543:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2553:2559:2562:2899:3138:3139:3140:3141:3142:3354:3865:3866:3867:3868:3870:3871:3872:3874:4117:4321:4385:5007:6261:6653:6742:7576:9010:9413:9592:10004:11026:11232:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12740:12895:13972:14093:14181:14394:14721:21060:21080:21444:21627:21666:21795:21939:21990:22119:30051:30054:30070:30090,0,RBL:209.85.214.194:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yre3aib8xx7h9i9gp1dgoc9o7daoc7jzy8bb7kk9rmczufxshrdbs3wwejxya.hj1or6oddu1pth5a4upmgx797ci1wu3brwsqim54fead4tppiq595kg994pkz6o.n-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: slope49_6206d9026f83 X-Filterd-Recvd-Size: 6123 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 12:21:43 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id o1so17240853plk.1 for ; Fri, 31 Jul 2020 05:21:43 -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=LNtUR/zVIQaYBxFfor/p8rzccCbsJTTUqM4Vi3aweCQ=; b=sbKje5uIs6vCbwISQGSsY7ywCySYHLZXwGfBBzrrDlpKgZEwgXpkNnojXjn7XLjGP/ LCVVujswgi1kcKfAHve7pLUcRsbbTqELSBhvEYUW/53GDHRah+nKmDcVdOyNptggcte0 V3SW4VKwwje/98Hpyg8fTcf8q1o93Sg4eMBrrazVM2rqH79v8HW8x7qrDmwCC+ngDeSS ch8A6lSwj//OBO1B2xpREwfP/rmOxj82xg8rBvQQjx7geQJvQS5ZxCFkLL6dW/FCi506 m/rDix44wr2xoGqudd1ZNDA06C+fNSIJMkkHKMloNYydDjMPuZc2u+LIp64Yuur2h1pA RJ7Q== 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=LNtUR/zVIQaYBxFfor/p8rzccCbsJTTUqM4Vi3aweCQ=; b=KaHZ55vIZHmFckV/GhS4e8c4PY1nEshk5cL209y9cFI9WjqcgiM5M3mzo43ZY/D0Tt RGHih+FFjx2A9N4NPIFQJ54CaoWZtS7GIdKBucTH0KOW3yaML/TGLSi+AIVPBIePOBNn ZgUEyaVfnifAveiFoKipwC4yamIAIBTTMhCJGSklML5FqZWaM4KYCMdy+5DxP3vsmjJd MpkSaP1NdvWV3lFGnV6wyLtvUOVbbWrevRXgX2cqBDFs7cbfnladTz2lVN9AgXSt2IsM ZPK7yxSB2q3hBNMQ52+Ojoo7m6hy66JsihFUp7eLTQ62irTlnaBambalN4oNrV34THZ2 kPug== X-Gm-Message-State: AOAM5324lc+BkxEltxajR2l5tzcMGy1ryrOOcLhCYGqDR2qz7+fKkQ/E yLmnnRTmQdqSLsesFO77PZhGtVc4WQ== X-Google-Smtp-Source: ABdhPJxYEpIrkMi6DnA+PXFhpdicTO+XfTlrSG7PPUPUyCZCiyePLqhVJJpOvhq2DRtPaUJItgn1AQ== X-Received: by 2002:a65:5c43:: with SMTP id v3mr3378625pgr.214.1596198102753; Fri, 31 Jul 2020 05:21:42 -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.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:21:42 -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 08/16] mm,hwpoison: remove MF_COUNT_INCREASED Date: Fri, 31 Jul 2020 12:21:04 +0000 Message-Id: <20200731122112.11263-9-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: 3218428A4E8 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Now there's no user of MF_COUNT_INCREASED, so we can safely remove it from all calling points. Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador --- include/linux/mm.h | 7 +++---- mm/memory-failure.c | 14 +++----------- 2 files changed, 6 insertions(+), 15 deletions(-) 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..c09111e8eac8 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 @@ -2976,10 +2976,9 @@ void register_page_bootmem_memmap(unsigned long section_nr, struct page *map, unsigned long nr_pages); enum mf_flags { - MF_COUNT_INCREASED = 1 << 0, - MF_ACTION_REQUIRED = 1 << 1, - MF_MUST_KILL = 1 << 2, - MF_SOFT_OFFLINE = 1 << 3, + MF_ACTION_REQUIRED = 1 << 0, + MF_MUST_KILL = 1 << 1, + MF_SOFT_OFFLINE = 1 << 2, }; extern int memory_failure(unsigned long pfn, int flags); extern void memory_failure_queue(unsigned long pfn, int flags); 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 6853bf3a253d..9768ab5f51ef 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 @@ -1118,7 +1118,7 @@ static int memory_failure_hugetlb(unsigned long pfn, int flags) num_poisoned_pages_inc(); - if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p)) { + if (!get_hwpoison_page(p)) { /* * Check "filter hit" and "race with other subpage." */ @@ -1314,7 +1314,7 @@ int memory_failure(unsigned long pfn, int flags) * In fact it's dangerous to directly bump up page count from 0, * that may make page_ref_freeze()/page_ref_unfreeze() mismatch. */ - if (!(flags & MF_COUNT_INCREASED) && !get_hwpoison_page(p)) { + if (!get_hwpoison_page(p)) { if (is_free_buddy_page(p)) { action_result(pfn, MF_MSG_BUDDY, MF_DELAYED); return 0; @@ -1354,10 +1354,7 @@ int memory_failure(unsigned long pfn, int flags) shake_page(p, 0); /* shake_page could have turned it free. */ if (!PageLRU(p) && is_free_buddy_page(p)) { - if (flags & MF_COUNT_INCREASED) - action_result(pfn, MF_MSG_BUDDY, MF_DELAYED); - else - action_result(pfn, MF_MSG_BUDDY_2ND, MF_DELAYED); + action_result(pfn, MF_MSG_BUDDY_2ND, MF_DELAYED); return 0; } @@ -1648,9 +1645,6 @@ static int __get_any_page(struct page *p, unsigned long pfn, int flags) { int ret; - if (flags & MF_COUNT_INCREASED) - return 1; - /* * When the target page is a free hugepage, just remove it * from free hugepage list. @@ -1930,8 +1924,6 @@ int soft_offline_page(unsigned long pfn, int flags) if (PageHWPoison(page)) { pr_info("soft offline: %#lx page already poisoned\n", pfn); - if (flags & MF_COUNT_INCREASED) - put_page(page); return -EBUSY; }