From patchwork Wed Jun 24 15:01:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11623383 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 9DFF7912 for ; Wed, 24 Jun 2020 15:03:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6A9342082F for ; Wed, 24 Jun 2020 15:03:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QeREAFiE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A9342082F 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 6245B6B0023; Wed, 24 Jun 2020 11:03:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5D41D6B0024; Wed, 24 Jun 2020 11:03:11 -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 4C2C16B0025; Wed, 24 Jun 2020 11:03:11 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0021.hostedemail.com [216.40.44.21]) by kanga.kvack.org (Postfix) with ESMTP id 34CEC6B0023 for ; Wed, 24 Jun 2020 11:03:11 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id E72C718012CDA for ; Wed, 24 Jun 2020 15:03:10 +0000 (UTC) X-FDA: 76964423340.10.dolls70_1b0185326e45 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 407649994 for ; Wed, 24 Jun 2020 15:02:16 +0000 (UTC) X-Spam-Summary: 1,0,0,fa934708419eaffa,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: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.210.196:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yr46yesoqam1g7t9pn4fwuz1qi8yc14o4wzgmwdg3r46u9cux3qzqkbashqgo.kuhty7ytnjjg9cjrzp1c3w6g3o9fay3cp7eoda4jdju9iwbsuzhrdbmnp3rw448.o-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:25,LUA_SUMMARY:none X-HE-Tag: dolls70_1b0185326e45 X-Filterd-Recvd-Size: 6109 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 15:02:08 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id j1so1281674pfe.4 for ; Wed, 24 Jun 2020 08:02:08 -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=WIp32P5EtOq+fwbI5DTsLYoiz2wHcW1kKrBDwwP58qc=; b=QeREAFiEgaNBS4YRTqqFz2rem0RoU+ypFV3pOa3g9stlE+R4D1whcZhBtTL+hNIylf WYRaVIXj0M47cSmcdflAEHp7L8cHP9X8MXErtgXs8J3oJ/V9u1Er5qau1FMStlctTE3q wAH1VadiOn20gm2EJs2NOGJS0jsv+0zUzh5ntz/sGG+njNrEiPCn1RSw3KRDJ7HHe+wG 9CJiMNUxUG6eBh1jf3EsZ2hRVpcOjKMI671AQ2YL3PflTWugVTgoLQ9R1NyfDx5CnLtN ntvYw/FFqfVGFzQ4bKqQVv+3B6Z/XDAHDk9lF/XyiUF02CIgjL7YcBrotCGSVgul+GAP MuMw== 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=WIp32P5EtOq+fwbI5DTsLYoiz2wHcW1kKrBDwwP58qc=; b=rZU0p941YyTLuRXSDZGlTtMaPMGqq0/W7fBWUgaoPe3tEmh2IWBkbcRXB2JadCkQCT sY3aLrOZcXehEhfvmoYPu3ePgA3b9zrDH7AgBnXfrbbwkOH4dldX91QdhHRIf6d9VmSH gXrt8xp+BTiCkRDfrJmpxIp2ODUzNgJKSt7OcciMzzfs7IRo1K2GmoYL/OKDhpdpUPNn pMJdt4ugxWeOyncUFVr1NTco/+v9TBmwAA5rAqAqogr/rjbJlvJTChr5WIjqzRqeFjEq KLrwNO5kwWvBDNRPqOhD8IJRmMHK2nY/kEEAAWHX/5kIUZ+viv+Hw+z5ZTNwSQjwbo1A wljw== X-Gm-Message-State: AOAM531NnnZX7svP94+DosxtgFXAdQwUz4Ct6EkMjpE8S/D9gV/mHdDR +FWRWv6W1fni/QfvfxTSYnjUOT2TKg== X-Google-Smtp-Source: ABdhPJxcv5SZFzXZ84c+ThvF5kyNv7fJOWZ9YSNA90GU6F5kZmjIk37nmIyvzofkgL5cHZeJ6WHdOg== X-Received: by 2002:a62:de84:: with SMTP id h126mr28948688pfg.37.1593010927232; Wed, 24 Jun 2020 08:02:07 -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 i125sm17013705pgd.21.2020.06.24.08.02.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:02:06 -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, naoya.horiguchi@nec.com, linux-kernel@vger.kernel.org Subject: [PATCH v3 08/15] mm,hwpoison: remove MF_COUNT_INCREASED Date: Wed, 24 Jun 2020 15:01:30 +0000 Message-Id: <20200624150137.7052-9-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200624150137.7052-1-nao.horiguchi@gmail.com> References: <20200624150137.7052-1-nao.horiguchi@gmail.com> X-Rspamd-Queue-Id: 407649994 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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-rc1-mmots-2020-06-20-21-44/include/linux/mm.h v5.8-rc1-mmots-2020-06-20-21-44_patched/include/linux/mm.h index c64ffec363b5..229efb3479b1 100644 --- v5.8-rc1-mmots-2020-06-20-21-44/include/linux/mm.h +++ v5.8-rc1-mmots-2020-06-20-21-44_patched/include/linux/mm.h @@ -2986,10 +2986,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-rc1-mmots-2020-06-20-21-44/mm/memory-failure.c v5.8-rc1-mmots-2020-06-20-21-44_patched/mm/memory-failure.c index 0b7d9769cf29..15b8e7fd94ed 100644 --- v5.8-rc1-mmots-2020-06-20-21-44/mm/memory-failure.c +++ v5.8-rc1-mmots-2020-06-20-21-44_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; } @@ -1655,9 +1652,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. @@ -1933,8 +1927,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; }