From patchwork Wed Jun 24 15:01:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11623369 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 1C2DB60D for ; Wed, 24 Jun 2020 15:02:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D5C31206EB for ; Wed, 24 Jun 2020 15:02:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EQ5vFoRh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5C31206EB 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 AB9D96B000A; Wed, 24 Jun 2020 11:02:20 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A8F9B6B000C; Wed, 24 Jun 2020 11:02:20 -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 97F576B000D; Wed, 24 Jun 2020 11:02:20 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 80CCA6B000A for ; Wed, 24 Jun 2020 11:02:20 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2456F9435 for ; Wed, 24 Jun 2020 15:02:20 +0000 (UTC) X-FDA: 76964421240.29.dust69_2a13a7f26e45 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 61F2118088030 for ; Wed, 24 Jun 2020 15:01:56 +0000 (UTC) X-Spam-Summary: 1,0,0,191f4fe7b2928243,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: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:30070,0,RBL:209.85.216.65:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04ygats4f1jieod9rnun8kikdghfaocedmyrn68ojbbp1be9p3nuuftt4jft7cp.mnxx9sk8a1ks55dz3i1g9bgjd7c4nojp8q81io578p3shyp87z9bg7ua5f135qy.k-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: dust69_2a13a7f26e45 X-Filterd-Recvd-Size: 4397 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf19.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 15:01:49 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id i4so1273957pjd.0 for ; Wed, 24 Jun 2020 08:01:49 -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=44MI/Xaebogle3byf0K/hbjxI15crYL5kj8QhCCzmQA=; b=EQ5vFoRhF+Dxmx9u/l3YuFN2NQ/we8WRaTM7Lbb+HasxiRQIshvNWwzDn2TRo6H5h8 NJFxR9veJODp4lBLCyrYVN+Cya1oe+8ppdH1N2LYrhOVXuXbQgNH/UIampBwrC1S9jrw kbjWyxO0XJ7ocBMiWBt5cFImGcAQYU/yrdeqzbGPidbceWfEdNLUzOPJh9wXOiTTzi/I OQ89WCvmCYd9I7AxgSoVLgcBrLyFXjBV0LSD2/M7uyCz3zZa/mrnn7tZPekS5UT2JXU0 3diAQnd8ZB5E0ZhFmPYz8tDI8Utwg3ZPtvYhtZkcq8Kfu8viHjXwsgai4ic7ZyG4y9xe P6/Q== 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=44MI/Xaebogle3byf0K/hbjxI15crYL5kj8QhCCzmQA=; b=mnyXp7wOUPZhGqaZcw/Sfnz3BH0Z0JEUvm0NhjgXzJPFtX+Jc/SMq01G2fcSgWdTzx P+uX14tPA/+tYMHQHS4LgkOew5aMOzMXRpaOtuTAT0g6svkAJG5rju4Sr7jxYK2BaAMZ Dd4GTGHsRwWdakZkVQPX3PhPEkpMd20Ey5oqHjHPRqsLv/OQZ1QJXWGOITDEkYmw7OZQ 25DA51urOKe52Zt2TOeEAjCYFO9Z3/RBVAwSXN5mU7AP9q1dNT+BPGbZDBVbaU7rCBOK qm4NZDoVuWCeM02DCT0yTB4EjVdds4qZWgN53wZwkK49SgoxtHM2UOKUD/mK6IfWuEuA XnYw== X-Gm-Message-State: AOAM530tuKPx9d74jVyZGh0aFe3RDhoZoAxDq44budAFppazS99tYLHy eDb5dFjNjYFtvGD0sdw5yDcj93yhJg== X-Google-Smtp-Source: ABdhPJyHPrGdh1QNyO3qvNQ7njQOvx6xQmbxOT6KvZfUmzZ8Kl5sDHMCYDfiH2fKVFHMhvkmzWiBQA== X-Received: by 2002:a17:90a:fd90:: with SMTP id cx16mr2508625pjb.42.1593010908500; Wed, 24 Jun 2020 08:01:48 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:01:48 -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 02/15] mm, hwpoison: remove recalculating hpage Date: Wed, 24 Jun 2020 15:01:24 +0000 Message-Id: <20200624150137.7052-3-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: 61F2118088030 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 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 Reviewed-by: Mike Kravetz --- mm/memory-failure.c | 6 +----- 1 file changed, 1 insertion(+), 5 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 e5d0c14c2332..d2d6010764e7 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 @@ -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;