From patchwork Fri Jul 31 12:20:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11694827 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 3A122913 for ; Fri, 31 Jul 2020 12:21:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 05DC92087C for ; Fri, 31 Jul 2020 12:21:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MLRvIBPy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05DC92087C 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 5DD508D0024; Fri, 31 Jul 2020 08:21:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5641A8D000B; Fri, 31 Jul 2020 08:21:23 -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 3BA498D0024; Fri, 31 Jul 2020 08:21:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0157.hostedemail.com [216.40.44.157]) by kanga.kvack.org (Postfix) with ESMTP id 0E9FF8D000B for ; Fri, 31 Jul 2020 08:21:23 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C0898824805A for ; Fri, 31 Jul 2020 12:21:22 +0000 (UTC) X-FDA: 77098281204.26.death45_5406dbe26f83 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 656C21804B65C for ; Fri, 31 Jul 2020 12:21:22 +0000 (UTC) X-Spam-Summary: 1,0,0,61f9c3cfe9335b0f,d41d8cd98f00b204,nao.horiguchi@gmail.com,,RULES_HIT:41:355:379:541:800:960:968:973:981:988:989:1260:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2899:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:4321:5007:6261:6653:6742:7576:8957:9413:10004:11026:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12740:12895:13069:13311:13357:14096:14181:14384:14394:14721:21060:21080:21222:21444:21627:21666:22119:30012:30046:30054:30064:30070:30079,0,RBL:209.85.214.194:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yr11nag86ofis5eix33rfojyry6opdwtax7s65ikqi37pg5kiabxmcwiyh9ri.4pati96mrt7cmom43bxrncxagga88hk3oqa4mqyitbqbytbc67ktd6r4t18gq95.1-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: death45_5406dbe26f83 X-Filterd-Recvd-Size: 4340 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf12.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 12:21:22 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id b9so17221747plx.6 for ; Fri, 31 Jul 2020 05:21:21 -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=pS0WhU6WE8IYcQCnD1IwwP5QRHOYUjKqdATKfccEtHE=; b=MLRvIBPy5vqHYOrJlKbuO+hv+7xtTvwRappzGjqJukqCM0eBVWt6DsxRLnwWNYS5GL 5l3SSvwdz0LgMaCUAnjg0HOQl2EbBMFmBqPs9VD4JhVaTcCpyUu6SWbyfMW8aBKwIjYe v+b0EZVomIUg7AsgLIBernDe2VaddoZoE1KSwBautGPyYU6Eio8RVl8oRLk6Wtm3F5Al pv8zQRFG78hNGhNre4/0LDEP1L8XUlHvPh9xaCOcQ7NQ2T1oOFvf00XoE5bljF50yW86 vYj5A4tYt4RYzkhRPFdDj7mzY5crKu9AqqqFmTeK9hUhyxB6SOubKzz7kNsvgRznFFBQ HxzA== 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=pS0WhU6WE8IYcQCnD1IwwP5QRHOYUjKqdATKfccEtHE=; b=EmGJuYwObqqL7a/HFImlQetM5xKU7nZLFzHg25GYQdqnm9UiGiowVTtSVB3mCu7kGt byqo2KFR+MmF12Wu4lRHfwOjguBasDCCona/8Frs//0gToXjF2EpxLHuHqTvVPVDKGoQ n6RkNCIpJc+RGvW291H5c7HRyoph7Jsy+hDIMhY6zz5xaA8V3gfMEgZGvaY9H50rf00O XVqFVmiG8/VFMXedIMAoHIt8msf39oJG3p7y2PmK8oyrJqiDAwvYp7fA41waBAQxySk+ BJUaoO9zZ1EbKqdPwRu+l3oC7CThtbcP7eA1Wykf5UZnQvxxFWSQWK1x6THHxTjpGNJS BXbw== X-Gm-Message-State: AOAM5338Bx6Jrg8gSv6U+gzRzUF4EotelpBJRSn8wZJsjYmevtuX1GNS Dw7icIyir2ek30Q1eJ5+Ad0qEnJdvA== X-Google-Smtp-Source: ABdhPJyexxScAh6tJturIlM6+21A1G4mPGy9rhb+3ZLAMULac3Oa3rj79jfqnQ4zsDb+GEJ4UvcFaw== X-Received: by 2002:a17:90a:9f84:: with SMTP id o4mr3700149pjp.200.1596198081054; Fri, 31 Jul 2020 05:21:21 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:21:20 -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 01/16] mm,hwpoison: cleanup unused PageHuge() check Date: Fri, 31 Jul 2020 12:20:57 +0000 Message-Id: <20200731122112.11263-2-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: 656C21804B65C 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 Drop the PageHuge check, which is dead code since memory_failure() forks into memory_failure_hugetlb() for hugetlb pages. memory_failure() and memory_failure_hugetlb() shares some functions like hwpoison_user_mappings() and identify_page_state(), so they should properly handle 4kB page, thp, and hugetlb. Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador Reviewed-by: Mike Kravetz --- mm/memory-failure.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 fe53768e0793..3d2d61f1c6e9 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 @@ -1382,10 +1382,7 @@ int memory_failure(unsigned long pfn, int flags) * page_remove_rmap() in try_to_unmap_one(). So to determine page status * correctly, we save a copy of the page flags at this time. */ - if (PageHuge(p)) - page_flags = hpage->flags; - else - page_flags = p->flags; + page_flags = p->flags; /* * unpoison always clear PG_hwpoison inside page lock