From patchwork Sat Sep 26 04:19:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11801093 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 AAE67112C for ; Sat, 26 Sep 2020 04:19:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6CD952078B for ; Sat, 26 Sep 2020 04:19:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="v3sh1qqi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CD952078B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9A8226B006E; Sat, 26 Sep 2020 00:19:17 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9577C6B0070; Sat, 26 Sep 2020 00:19:17 -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 86D526B0071; Sat, 26 Sep 2020 00:19:17 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0040.hostedemail.com [216.40.44.40]) by kanga.kvack.org (Postfix) with ESMTP id 756CC6B006E for ; Sat, 26 Sep 2020 00:19:17 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3DB8A180AD801 for ; Sat, 26 Sep 2020 04:19:17 +0000 (UTC) X-FDA: 77303907954.28.fuel02_420e5dd2716d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 201AF6C04 for ; Sat, 26 Sep 2020 04:19:17 +0000 (UTC) X-Spam-Summary: 1,0,0,81308be839c583a9,d41d8cd98f00b204,akpm@linux-foundation.org,,RULES_HIT:41:355:379:800:960:967:973:988:989:1260:1345:1359:1381:1431:1437:1534:1541:1711:1730:1747:1777:1792:1963:2393:2525:2559:2563:2682:2685:2859:2892:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3865:3866:3868:3871:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:5007:6119:6120:6261:6653:7576:7901:7903:8957:9010:9025:9545:10004:11026:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12679:12986:13069:13141:13230:13311:13357:13846:14096:14181:14384:14721:21080:21451:21627:21809:21939:21990:30012:30054:30064:30075,0,RBL:198.145.29.99:@linux-foundation.org:.lbl8.mailshell.net-62.2.0.100 64.100.201.201;04ygyzcf4p7rhsu7i5ccpd9uc8bjpopf4enf6n8eb3zyefqa8h7rbi4mriay9w8.en75n4rfgea1h7z9xxqjp4qpwjrbwtgmkt5bodtwr85zid831szrkm6ggi3uzq6.a-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF X-HE-Tag: fuel02_420e5dd2716d X-Filterd-Recvd-Size: 2960 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Sat, 26 Sep 2020 04:19:16 +0000 (UTC) Received: from localhost.localdomain (c-71-198-47-131.hsd1.ca.comcast.net [71.198.47.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 666E12080A; Sat, 26 Sep 2020 04:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601093955; bh=9u43UOtPeXYOn2SAd52yJxsE9rs6wq54p1naXXmefTI=; h=Date:From:To:Subject:In-Reply-To:From; b=v3sh1qqiMSmEFOL/yDNG06CSyJqEShYwTy6vEW13fuZvAWNvqjQO04eNosEmTuEBM TaNCzJXzmirgMw2x0Vh/jY8cmEViyT1xO6gZ/GHbqGerZtP3D9NxW9q+vKv+bUIRNh +7FPzZJSFZK4W5ixn3IC4Yspu2IVzefmiJim80UY= Date: Fri, 25 Sep 2020 21:19:14 -0700 From: Andrew Morton To: akpm@linux-foundation.org, anshuman.khandual@arm.com, daniel.m.jordan@oracle.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, ziy@nvidia.com Subject: [patch 4/9] mm/migrate: correct thp migration stats Message-ID: <20200926041914.Hj7iz37ld%akpm@linux-foundation.org> In-Reply-To: <20200925211725.0fea54be9e9715486efea21f@linux-foundation.org> User-Agent: s-nail v14.8.16 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: Zi Yan Subject: mm/migrate: correct thp migration stats PageTransHuge returns true for both thp and hugetlb, so thp stats was counting both thp and hugetlb migrations. Exclude hugetlb migration by setting is_thp variable right. Clean up thp handling code too when we are there. Link: https://lkml.kernel.org/r/20200917210413.1462975-1-zi.yan@sent.com Fixes: 1a5bae25e3cf ("mm/vmstat: add events for THP migration without split") Signed-off-by: Zi Yan Reviewed-by: Daniel Jordan Cc: Anshuman Khandual Signed-off-by: Andrew Morton --- mm/migrate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/mm/migrate.c~mm-migrate-correct-thp-migration-stats +++ a/mm/migrate.c @@ -1446,7 +1446,7 @@ retry: * Capture required information that might get lost * during migration. */ - is_thp = PageTransHuge(page); + is_thp = PageTransHuge(page) && !PageHuge(page); nr_subpages = thp_nr_pages(page); cond_resched(); @@ -1472,7 +1472,7 @@ retry: * we encounter them after the rest of the list * is processed. */ - if (PageTransHuge(page) && !PageHuge(page)) { + if (is_thp) { lock_page(page); rc = split_huge_page_to_list(page, from); unlock_page(page); @@ -1481,8 +1481,7 @@ retry: nr_thp_split++; goto retry; } - } - if (is_thp) { + nr_thp_failed++; nr_failed += nr_subpages; goto out;