From patchwork Wed Jun 24 15:01:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11623375 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 0F53560D for ; Wed, 24 Jun 2020 15:02:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CFF0D206C0 for ; Wed, 24 Jun 2020 15:02:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UwaotPoi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFF0D206C0 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 0809F6B0010; Wed, 24 Jun 2020 11:02:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0580E6B0022; Wed, 24 Jun 2020 11:02:46 -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 EB00F6B0023; Wed, 24 Jun 2020 11:02:45 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0208.hostedemail.com [216.40.44.208]) by kanga.kvack.org (Postfix) with ESMTP id D293D6B0010 for ; Wed, 24 Jun 2020 11:02:45 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 87A40181AC9C6 for ; Wed, 24 Jun 2020 15:02:45 +0000 (UTC) X-FDA: 76964422290.19.sign88_1f1003926e45 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id B01231AD809 for ; Wed, 24 Jun 2020 15:01:54 +0000 (UTC) X-Spam-Summary: 1,0,0,6431b0ec9a101500,d41d8cd98f00b204,nao.horiguchi@gmail.com,,RULES_HIT:41:355:379:541:800:960:968:973:981:982: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:7576:8957:9413:10004:11026:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12740:12895:12986:13069:13311:13357:14096:14181:14384:14394:14721:21060:21080:21222:21444:21627:21666:22119:30012:30046:30054:30070:30079,0,RBL:209.85.216.67:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04ygq548x6ct459c9r5we85y6ewaqyc6hxipd4sz67m49fhzxofcn4ctyu4cho7.m7hym3f9i9h6c7nfgtohscop19ro5fsmz8sbt3b9i8udb8ofhakkmxooy1n4p5r.6-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: sign88_1f1003926e45 X-Filterd-Recvd-Size: 4367 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 15:01:46 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id jz3so1279378pjb.0 for ; Wed, 24 Jun 2020 08:01:46 -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=lCfhSpDjLg0oQm41kWMqoMza5V2vl2PVe0Cy2zdpUs4=; b=UwaotPoi71Q37vlpe0idrCVUeedFZnNJi7hm4BN/zg+fqUR/nfv8+x/cMKGbRswW6K nDRh8yun2BNbgOmjhg2BmgGXGsFf5M2ZAr4Kl9dTIAVodNCsqmTIEXtEURu/4SURPh14 vqVq7YW5Ctj0JIxt6FtaNcx5DQp9AmkIHpEXWmAX7iZZ9fxUbVkfo9ptpLZS1+zqe5z0 FUvFEpMYMtvuni7uuKF2E7BLXluQ8BAoYlp02MLUDRykv138y8b9a+Q234TNYXVq20NG n7utb0dCNuvTssYtKNY2gC5CCPvqqsCksE3B0/Lj80ocPbu+XsGOH/sWKJ7rrlim8cFS 62Kw== 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=lCfhSpDjLg0oQm41kWMqoMza5V2vl2PVe0Cy2zdpUs4=; b=MmVTYSCdNmVUk2mRLBrY7mLj2QP9slFN6PZvDybm+btd0zMH6NvkeGh9yNZHYVMTd3 1nz5BYDaDv5svsHXNusN2aEhB4HdgmVfqkwqDvh7H+4WgIXjRNaho+dkwbjXhNGIoAaX Mvbc6t/KT28Jmftu+ejyNb0/KUO3wAaBXaZXGc1mq0tZloLFVViJ/Wrie54jmriaWq0m C7DTK7XRdjBp8RCY9pPblPGb1R8QHQbghsMbr1FaPyq+QFzPpgDnBj37yWFvbyhgZrSh vE7N2xXCUi19GTuSTDXY1deJ0r5VcKvcBTKSReg6vIBBQP4sIX9sRsimtRE/OIBNAqJB ivRQ== X-Gm-Message-State: AOAM530Gg5txxOfm73fBWgb/fCLY78neGfZ73oYI+kfIswQXPoh5EAcB JmBQ5m0+rWWB2VG4aabPM2MKbKhY5g== X-Google-Smtp-Source: ABdhPJw1QP92/ouJDzFZIrN4onjqHXS1nPeUFAid6e2y7e70YPrRcwv0Aq6U4DIjcbRurGP8vn/3eA== X-Received: by 2002:a17:902:d207:: with SMTP id t7mr12891961ply.251.1593010905510; Wed, 24 Jun 2020 08:01:45 -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.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:01:45 -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 01/15] mm,hwpoison: cleanup unused PageHuge() check Date: Wed, 24 Jun 2020 15:01:23 +0000 Message-Id: <20200624150137.7052-2-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: B01231AD809 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 --- changelog v2 -> v3: - add description about shared logic b/w hugetlb and non-hugetlb path. --- mm/memory-failure.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 47b8ccb1fb9b..e5d0c14c2332 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 @@ -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