From patchwork Thu Sep 17 21:04:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 11783561 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 0B0D792C for ; Thu, 17 Sep 2020 21:04:32 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 962E0208C3 for ; Thu, 17 Sep 2020 21:04:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sent.com header.i=@sent.com header.b="dMHDqaFa"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="bBuLRM51" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 962E0208C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=sent.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 7E6ED6B0003; Thu, 17 Sep 2020 17:04:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 76F196B0037; Thu, 17 Sep 2020 17:04:30 -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 6364C6B005C; Thu, 17 Sep 2020 17:04:30 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0003.hostedemail.com [216.40.44.3]) by kanga.kvack.org (Postfix) with ESMTP id 481FC6B0003 for ; Thu, 17 Sep 2020 17:04:30 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0A9B18249980 for ; Thu, 17 Sep 2020 21:04:30 +0000 (UTC) X-FDA: 77273781900.22.bed24_350d39027125 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin22.hostedemail.com (Postfix) with ESMTP id DE78A18038E60 for ; Thu, 17 Sep 2020 21:04:29 +0000 (UTC) X-Spam-Summary: 1,0,0,8f7b61b7b7607e02,d41d8cd98f00b204,zi.yan@sent.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1431:1437:1515:1535:1541:1711:1730:1747:1777:1792:1963:2393:2559:2562:2892:3138:3139:3140:3141:3142:3352:3865:3866:3868:3871:3874:4250:4321:5007:6119:6120:6261:6653:7576:7901:7903:8957:9010:10004:11026:11658:11914:12296:12438:12555:12679:12895:13069:13141:13230:13311:13357:13894:14096:14181:14384:14394:14721:21080:21451:21627:21809:21990:30012:30054:30064:30075,0,RBL:66.111.4.26:@sent.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100;04y8hempmi4bcasz3zzowsksfc1ipoc39hmopt6mg34i7d739bgwesuz1d4hapf.6495z3ooi6gbd5iounp9xy1q6rfboja1xuyr15tuf6ex5tfsqw4yyn5z3juk9z8.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:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: bed24_350d39027125 X-Filterd-Recvd-Size: 5172 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by imf41.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 21:04:29 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DCDF95C0237; Thu, 17 Sep 2020 17:04:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 17 Sep 2020 17:04:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=from :to:cc:subject:date:message-id:reply-to:mime-version :content-transfer-encoding; s=fm1; bh=J6L2UYFGptZ2yYfZRWaSnPrub0 tg5wrrKaCkeegrAac=; b=dMHDqaFagAGff2Q9pBg1lePQktQCbfUROCz+v88YB+ ul/1BOxUV9GWjC1OoOKINXOc1mnANy5NU5QIP2Z7OoqpdhZrVvGhgScxNvvqCxrQ zKxxMdjrW8pVdtuzggnFAPlL72kyQgAiOU1Mr8eFtpIPcin0o7btYG1z/HXYNRO1 Fnf/EzNVlezMkstYv2Gy42OzWssI/irxHEtrGYDlW0tZYM/snuFaoGT7j03ivxwS 1acC9aiuEwVWjjJjoDQC8uem7WFgG7XcGJK1po6rvdBO420frjyNeiVbJf37fhQ1 Tg86KHjHLgtk3ON0GZk6RqErH3wyo1kGwXCB3F5daxqw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:reply-to:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=J6L2UY FGptZ2yYfZRWaSnPrub0tg5wrrKaCkeegrAac=; b=bBuLRM51BrDNvT9mbjV6ml rDKjEbkskrmCNJguxQbyJGSdoAu6iro8zCTHXnTpYypTDQF81wUo0TpqaatC7DOp zCbQyC7xWjSAiKSHDSCFv/dDZXfCcUxhju22pMo3RHqvIE3fcxABL/+Xsjbs+u+r 3F8bjokQswMtIZdzN5UqBFqgYVchQrUXcpy85swpfDIygusR+i0HJhnpr0b8mEsh Z2MAhv0JtaMjBK32ay8hARwIvhNMRzaVnzihOkrfTq+iHUhlcX69KyeQjbOoZHY4 Y38CnI4+qMEgAOISuak68lJMWfH15BLGz7kGM3v2UXy/oqKKJKocC5kqz5tR054g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrtdeggdduheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfforhgggfestdekredtredttdenucfhrhhomhepkghiucgjrghn uceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepgfellefhvd eitdehffejheelgfehtdevheejhffgledtieehtdejffefveeijeehnecukfhppeduvddr geeirddutdeirdduieegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepiihirdihrghnsehsvghnthdrtghomh X-ME-Proxy: Received: from nvrsysarch6.NVidia.COM (unknown [12.46.106.164]) by mail.messagingengine.com (Postfix) with ESMTPA id 666AB3280065; Thu, 17 Sep 2020 17:04:28 -0400 (EDT) From: Zi Yan To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zi Yan , Daniel Jordan , Anshuman Khandual Subject: [PATCH v2] mm/migrate: correct thp migration stats. Date: Thu, 17 Sep 2020 17:04:13 -0400 Message-Id: <20200917210413.1462975-1-zi.yan@sent.com> X-Mailer: git-send-email 2.28.0 Reply-To: Zi Yan MIME-Version: 1.0 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 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. Fixes: 1a5bae25e3cf ("mm/vmstat: add events for THP migration without split") Signed-off-by: Zi Yan Reviewed-by: Daniel Jordan Cc: Daniel Jordan Cc: Anshuman Khandual Reviewed-by: Anshuman Khandual --- mm/migrate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 941b89383cf3..6bc9559afc70 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1445,7 +1445,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, * 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(); @@ -1471,7 +1471,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, * 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); @@ -1480,8 +1480,7 @@ int migrate_pages(struct list_head *from, new_page_t get_new_page, nr_thp_split++; goto retry; } - } - if (is_thp) { + nr_thp_failed++; nr_failed += nr_subpages; goto out;