From patchwork Fri Jul 31 12:20:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11694829 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 8ED2F913 for ; Fri, 31 Jul 2020 12:21:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 525DB21D95 for ; Fri, 31 Jul 2020 12:21:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WH9dCgiO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 525DB21D95 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 2D0758D0027; Fri, 31 Jul 2020 08:21:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 208FE8D0025; Fri, 31 Jul 2020 08:21:26 -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 0826B8D0027; Fri, 31 Jul 2020 08:21:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0081.hostedemail.com [216.40.44.81]) by kanga.kvack.org (Postfix) with ESMTP id D7E778D0025 for ; Fri, 31 Jul 2020 08:21:25 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id A4DE13626 for ; Fri, 31 Jul 2020 12:21:25 +0000 (UTC) X-FDA: 77098281330.07.stamp11_250707326f83 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 746BE1803F9AA for ; Fri, 31 Jul 2020 12:21:25 +0000 (UTC) X-Spam-Summary: 1,0,0,469be48e7ebaa894,d41d8cd98f00b204,nao.horiguchi@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1359:1431:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:2895:2899:3138:3139:3140:3141:3142:3352:3865:3866:3867:3870:3871:4321:5007:6119:6261:6653:6742:7576:7903:9413:10004:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12679:12740:12895:13069:13311:13357:14096:14181:14384:14394:14721:21060:21080:21444:21451:21627:21666:21795:22119:30051:30054:30064:30070,0,RBL:209.85.216.68:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04ygd4iywdamcm6qe8j8sizosethbopb3r63bkhr1u39sa9ichxy7dxjrfnxx6z.8z87abptc5rjm1a8tnbec11d1shp8icjn7qyc4kh3rhfpmi7b3dkq6qmfb8ctyt.w-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:none,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: stamp11_250707326f83 X-Filterd-Recvd-Size: 4512 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 12:21:24 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id a9so7212619pjd.3 for ; Fri, 31 Jul 2020 05:21:24 -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=qrNOopevZrXOPbrUYdqc/luUXjhR4msmU2SD/x7wn8s=; b=WH9dCgiO5HBSnguxla+ODFX+58yP55FDN85r1k7Xc0tjEBA7/8Y7Ch2O85TIWJU5Zj od7uQJV/H6YraW6Rm48YMoGsmqjiwFaS3jQ8BpARANZ5MKWhWodJvPLk0Qy4h8ufVJY4 ZVjQFAuRWkEPboJX16lJwqsNOknYnqAB8kjdyL3ugGNcH+pnASg/Td4s0zXFQtsSMSqF BNYJp2L+kSBJn3OXXfNamLP2Podb6Ow0fekn3qQhte4yzJzwU1Y6jKAB6py+fh/THd8y S9Pm3Dx8YfAHd87lMiB2UatTv52EzEmzwgoHEWQlEzZVS+O5AyGwnHESLsUoymdc5U+4 wmxg== 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=qrNOopevZrXOPbrUYdqc/luUXjhR4msmU2SD/x7wn8s=; b=HlohPEd8LpOJw6nEbimbqh3PCuGjCG5ZwF+/QgZIJq0/XlSPZUdZsqnHwJZOq6LzTe y5lS1mt/AIKi/Uc9hzAoKq5GkbAKgpITdnUwQ+I6r05DNj9UjrHxsH74CUr2gxu9LIbj z4ZXE6ZDPXDxc6QxlwFvrHAtnGHOGVVXvtUzAVgsARR3rh9I5p1YT8e0tiRK92DuFGe8 BsDisLEO/cIVh2/FTpPPyCJmHns1DYXEeqakKMdK334OCWR673C16cpBASx/tnPSGDCE 3c7MbAs8SUEg8aJ43J42t1U4W//YvpmcXor7TFz2XCDJUmSpSVkoVLB7RTEap0VHFdjm XjtQ== X-Gm-Message-State: AOAM531ZHWjhxrivewcp3U3qhfUl95busAG12dcB2kSLg10zgTzDs8Nw 0mmEhiTV+ciA9ElNkYlpHx9fUAj8KQ== X-Google-Smtp-Source: ABdhPJx8PolYkpiawKpv9KQGOzCfR/2h6vcz2gh903lD7zOol4BIdtxScC5xzPjV0Nvs/PYmFUz4ow== X-Received: by 2002:a63:3c41:: with SMTP id i1mr3580839pgn.349.1596198084144; Fri, 31 Jul 2020 05:21:24 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:21:23 -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 02/16] mm, hwpoison: remove recalculating hpage Date: Fri, 31 Jul 2020 12:20:58 +0000 Message-Id: <20200731122112.11263-3-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: 746BE1803F9AA 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 hpage is never used after try_to_split_thp_page() in memory_failure(), so we don't have to update hpage. So let's not recalculate/use hpage. Suggested-by: "Aneesh Kumar K.V" Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador Reviewed-by: Mike Kravetz --- mm/memory-failure.c | 6 +----- 1 file changed, 1 insertion(+), 5 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 3d2d61f1c6e9..f8d200417e0f 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 @@ -1342,7 +1342,6 @@ int memory_failure(unsigned long pfn, int flags) } unlock_page(p); VM_BUG_ON_PAGE(!page_count(p), p); - hpage = compound_head(p); } /* @@ -1414,11 +1413,8 @@ int memory_failure(unsigned long pfn, int flags) /* * Now take care of user space mappings. * Abort on fail: __delete_from_page_cache() assumes unmapped page. - * - * When the raw error page is thp tail page, hpage points to the raw - * page after thp split. */ - if (!hwpoison_user_mappings(p, pfn, flags, &hpage)) { + if (!hwpoison_user_mappings(p, pfn, flags, &p)) { action_result(pfn, MF_MSG_UNMAP_FAILED, MF_IGNORED); res = -EBUSY; goto out;