From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98896C43464 for ; Thu, 17 Sep 2020 21:04:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51AC02137B for ; Thu, 17 Sep 2020 21:04:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (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" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726685AbgIQVEa (ORCPT ); Thu, 17 Sep 2020 17:04:30 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:54823 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbgIQVE3 (ORCPT ); Thu, 17 Sep 2020 17:04:29 -0400 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; -- 2.28.0