From patchwork Thu Aug 6 18:49:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11704087 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 7899A913 for ; Thu, 6 Aug 2020 18:49:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A2BB922C9F for ; Thu, 6 Aug 2020 18:49:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dW+PgodN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2BB922C9F 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 461D86B0005; Thu, 6 Aug 2020 14:49:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 4387B6B0007; Thu, 6 Aug 2020 14:49:37 -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 351966B0008; Thu, 6 Aug 2020 14:49:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 208936B0005 for ; Thu, 6 Aug 2020 14:49:37 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C29932C1F for ; Thu, 6 Aug 2020 18:49:36 +0000 (UTC) X-FDA: 77121032352.05.verse69_5d0154b26fb9 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 92EA11801FA4E for ; Thu, 6 Aug 2020 18:49:36 +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.65:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yrjbkd4anwhgpbiw73cd47hfua1ypb3r63bkhr1u39sa9ichxy7dxjrfnxx6z.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:24,LUA_SUMMARY:none X-HE-Tag: verse69_5d0154b26fb9 X-Filterd-Recvd-Size: 4515 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Aug 2020 18:49:36 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id l60so7323887pjb.3 for ; Thu, 06 Aug 2020 11:49:36 -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=dW+PgodNF48RAaGwGN8hRaeeIti0F2ClybxPtutZjQItbJoVlpQkZDO8YGZYhEI+3i 3TUAxO+QufKjTV1DjSHQMdIzHR8kNbkPiimWo01mkhkWReUmIT/MU9HROGCVkwsrcuCQ NbzIx8sAdB1hKjhQLcO8nVs/hnUfCR1P7oDITfdVwT4gebqg27MKuQrFurk9DxYw+8q+ B9SdiirdfpyLP+6gdCPpJmMyt1QnRfL6SD5QWWPmbHHMB/hV3Q0IF3UChhGl4/uvng9t fpix0/uSNL+B4TnzZpS4SGzg+es9VjEekHF7iDNSRgxqyXXFLkUgdvHbzw2wjAxwmmiz LkSg== 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=gkk1rvaX0lbun+kgN1s4EQ0jBfP/CHXh0mc4vmIgrVkVbNGSFr9ncFtiUDpBvVJgGk 25yjQDfwK5XNE1NUJypjzfm78VJvKuJ/gYmlCrT3egTWlg2+KJKVbC7AOVeGUX/32y/m Ru7gPgaCweu9X/jl06EZtHimAYmcUkOpcU8S4k/tZGFcFJwiHPu+eyumnUqV8jXxVU+F 5Ks5Z2gjUADtG8dXW/517DwSCn6F12lAlRrY+iW+qaYRc7aOx08G6YP2g0ALu3trQVM3 xZVc0m5uP9ZEwmjs4vgAg+1gTo39/Moyehm86gIS7Ik5MCllQMrP/FhAONIqDnRIplzy MGyQ== X-Gm-Message-State: AOAM533W65n8/+2fGwQLsFL222kO3ZZ8itolaz50/F1RSU7Ug8YbIl1v wkSMFOZZL7O8kJlnRMr1OnYlnDXeEQ== X-Google-Smtp-Source: ABdhPJyGlRH9DZJICHEHHkgFtaCUSUovuGikU1NNYN8M6nMZv0PwUA/D0NIWAh5ptTVDgEknCjeFuw== X-Received: by 2002:a17:902:a50d:: with SMTP id s13mr9036876plq.135.1596739775259; Thu, 06 Aug 2020 11:49:35 -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 u24sm9096730pfm.20.2020.08.06.11.49.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 11:49:34 -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 v6 02/12] mm, hwpoison: remove recalculating hpage Date: Thu, 6 Aug 2020 18:49:13 +0000 Message-Id: <20200806184923.7007-3-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806184923.7007-1-nao.horiguchi@gmail.com> References: <20200806184923.7007-1-nao.horiguchi@gmail.com> X-Rspamd-Queue-Id: 92EA11801FA4E X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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;