From patchwork Tue Oct 17 16:31:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 13425620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 572EACDB483 for ; Tue, 17 Oct 2023 16:31:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D7D2680043; Tue, 17 Oct 2023 12:31:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2ECD8003F; Tue, 17 Oct 2023 12:31:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B804F80043; Tue, 17 Oct 2023 12:31:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A10248003F for ; Tue, 17 Oct 2023 12:31:44 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 77D16120D8D for ; Tue, 17 Oct 2023 16:31:44 +0000 (UTC) X-FDA: 81355494528.06.BDF2A8B Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by imf21.hostedemail.com (Postfix) with ESMTP id 3E0701C0020 for ; Tue, 17 Oct 2023 16:31:42 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=sent.com header.s=fm3 header.b=unvXa1k4; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=PJ7gUlT3; spf=pass (imf21.hostedemail.com: domain of zi.yan@sent.com designates 64.147.123.24 as permitted sender) smtp.mailfrom=zi.yan@sent.com; dmarc=pass (policy=none) header.from=sent.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697560302; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=1kkUVLmhYZKWaHKAN/xp7aL8gGntQ2zJwQBI6DdNoNU=; b=GxQ490u9za36jPlhp9jPJ0vHfdPoIk8wemzMAgqVAzJIgnkZTjsQ/UMQZz9X7NPheiE5Fo 7JV0DgvGZaFKRE9iiJjXOjGBTbd6XNCXowJvz81yPIAQeJqPI32EU3rTHqun2hfUfWj5V6 gmv5K1govhafIcWHGKN2hnhRbLrzAq0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697560302; a=rsa-sha256; cv=none; b=21oJa8jQYnUK6w5XMHGJD6ubDG8e8wzQunMJNxT04jNnlxBmXPv6AY1Zp38IMSmuT9Y3Hw xw/neRzLV5j9n+zozHsIhXzTs91IQwp5tnIF7kFKj1jquxdUZp9C2R1wRIP/M1PGFWiiLv tW55YzPk0Z9XS1ND2hQXOIZiU8o4UOk= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=sent.com header.s=fm3 header.b=unvXa1k4; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=PJ7gUlT3; spf=pass (imf21.hostedemail.com: domain of zi.yan@sent.com designates 64.147.123.24 as permitted sender) smtp.mailfrom=zi.yan@sent.com; dmarc=pass (policy=none) header.from=sent.com Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id EFF983200A2B; Tue, 17 Oct 2023 12:31:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 17 Oct 2023 12:31:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:sender:subject:subject:to:to; s=fm3; t= 1697560299; x=1697646699; bh=1kkUVLmhYZKWaHKAN/xp7aL8gGntQ2zJwQB I6DdNoNU=; b=unvXa1k4H/Q7Jd14QuUPoZ4jcQPo5sBEh1o0/eDJkujCX6U7beP nLH41Xgpe4pvssOe6gtCU9QDPKGBdlvmDNw4yxg1llrYmG8knOVw/82VQq96Uwo4 6y6K9KLnFIWYY3kACqOdaJaBGKfF9AueTa2/7h6p+RBBh+QTPGQanQj9wbhPs2Wc RObbk5G5SE2pHWZgMvenTvoEusWbtcSWWmmHuwjDmMNjbriu8zD7FZxSScFyAU++ bcV6VUTUXfKhq3wfxGM89ExEcpII8cZ6IrOOTlxZetRzEtRdkQ9PWg54NXwJfeXa db1DXiSSJ6kc0rwPgl0NRBV+67mJh28LPSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697560299; x=1697646699; bh=1kkUVLmhYZKWaHKAN/xp7aL8gGntQ2zJwQB I6DdNoNU=; b=PJ7gUlT3xyf2PcJF4ucbSQ9erQHE7TVNVKbQYEiQccw2LMr40XW 71t0mIFiDHwU4EOH6jKK1Mvv2PiFJrJBczuUX81w3okgCFxj+oom9KFTeMWGr6Ey 0YCiJK00XtIx1YyCPmmmVx4wvdlGMb43WsGLGcFprGjRiz1dToZodBSvGzPWPRHW euWGW61zhbCNpC1/GbbtJ+l4AKkyo5D1CCqGrOfu4vhuOlNg8llOABZBMEKSt8nE wdVEqOO1xLiNa63xg3rv7WQNJI4N/P3R7h/FLa82D0MY+YGv8tQNOJl0wm/5i4XC o3OkMlTpIDG52BWMZPM+GuDMGSCYifZiSZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedvgdellecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfrhgggfestdekredtredttdenucfhrhhomhepkghiucgj rghnuceoiihirdihrghnsehsvghnthdrtghomheqnecuggftrfgrthhtvghrnhepudfgfe elhfekiefgtedvudfghfduffefieefffejvefhlefhhffgkedtfeevhfevnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepiihirdihrghnsehsvg hnthdrtghomh X-ME-Proxy: Feedback-ID: iccd040f4:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Oct 2023 12:31:38 -0400 (EDT) From: Zi Yan To: Huang Ying , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Zi Yan , Andrew Morton , "Matthew Wilcox (Oracle)" , David Hildenbrand , Baolin Wang Subject: [PATCH v3 2/2] mm/migrate: add nr_split to trace_mm_migrate_pages stats. Date: Tue, 17 Oct 2023 12:31:29 -0400 Message-ID: <20231017163129.2025214-2-zi.yan@sent.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231017163129.2025214-1-zi.yan@sent.com> References: <20231017163129.2025214-1-zi.yan@sent.com> Reply-To: Zi Yan MIME-Version: 1.0 X-Rspamd-Queue-Id: 3E0701C0020 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: jcnz6tam99nwaz9du77uax6xdtemwr19 X-HE-Tag: 1697560301-303463 X-HE-Meta: U2FsdGVkX188XvpO2GQcxqtYuBd7/LKBTJJ1KgTZkPw6HotlvgFbv6P21r43K0VdOiG3DX0upCwcX47LzqGKN7wsbJ0VfLZmkAibiFkI8dSdMa6xO1OHlIpgR1TxqUhsxcE6h1vxq/z57A8DgXCsGiGxUcboVp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U+LKI5fjxH5Q4ZLQC2zD5H5cdwp0kZMLrPhldOM4mzxuCewZZpHf5VHm46wP6CaQLLFx42DLbMQhdRpIg8pCz4Uo7iDPF9pKBSVqhetRwIcJEvWCKu3WhwLRYbHiHCDz6DOnl+I+fixez2KueWIMpSwK3hhTkOeLyDGaOC8Ik0iAfBYbu1vGl+4cY+Rx2FXsrU0xYw2Bx5RDcvrBXbq/9GvL8FL92XKiogU1CFjZgSeomaBdQbxxn6N2wuCmld5QJKD4kBXLex3AGofjC1Etx1EwPFjO3JPRbupq7ktXtjWgM9lIGbKpS6rHaJhf01XTNxL8ZCUYEV2ic1ORexkeJp7rE5eZjzrXaYmmK5wBXK/H00owxk= 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 Add nr_split to trace_mm_migrate_pages for large folio (including THP) split events. Signed-off-by: Zi Yan Cc: Baolin Wang Cc: David Hildenbrand Cc: Huang Ying Cc: Matthew Wilcox Reviewed-by: Baolin Wang --- include/trace/events/migrate.h | 24 ++++++++++++++---------- mm/migrate.c | 3 ++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/trace/events/migrate.h b/include/trace/events/migrate.h index 061b5128f335..0190ef725b43 100644 --- a/include/trace/events/migrate.h +++ b/include/trace/events/migrate.h @@ -49,10 +49,11 @@ TRACE_EVENT(mm_migrate_pages, TP_PROTO(unsigned long succeeded, unsigned long failed, unsigned long thp_succeeded, unsigned long thp_failed, - unsigned long thp_split, enum migrate_mode mode, int reason), + unsigned long thp_split, unsigned long large_folio_split, + enum migrate_mode mode, int reason), TP_ARGS(succeeded, failed, thp_succeeded, thp_failed, - thp_split, mode, reason), + thp_split, large_folio_split, mode, reason), TP_STRUCT__entry( __field( unsigned long, succeeded) @@ -60,26 +61,29 @@ TRACE_EVENT(mm_migrate_pages, __field( unsigned long, thp_succeeded) __field( unsigned long, thp_failed) __field( unsigned long, thp_split) + __field( unsigned long, large_folio_split) __field( enum migrate_mode, mode) __field( int, reason) ), TP_fast_assign( - __entry->succeeded = succeeded; - __entry->failed = failed; - __entry->thp_succeeded = thp_succeeded; - __entry->thp_failed = thp_failed; - __entry->thp_split = thp_split; - __entry->mode = mode; - __entry->reason = reason; + __entry->succeeded = succeeded; + __entry->failed = failed; + __entry->thp_succeeded = thp_succeeded; + __entry->thp_failed = thp_failed; + __entry->thp_split = thp_split; + __entry->large_folio_split = large_folio_split; + __entry->mode = mode; + __entry->reason = reason; ), - TP_printk("nr_succeeded=%lu nr_failed=%lu nr_thp_succeeded=%lu nr_thp_failed=%lu nr_thp_split=%lu mode=%s reason=%s", + TP_printk("nr_succeeded=%lu nr_failed=%lu nr_thp_succeeded=%lu nr_thp_failed=%lu nr_thp_split=%lu nr_split=%lu mode=%s reason=%s", __entry->succeeded, __entry->failed, __entry->thp_succeeded, __entry->thp_failed, __entry->thp_split, + __entry->large_folio_split, __print_symbolic(__entry->mode, MIGRATE_MODE), __print_symbolic(__entry->reason, MIGRATE_REASON)) ); diff --git a/mm/migrate.c b/mm/migrate.c index fc2e70b17704..1fecebf4c301 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1979,7 +1979,8 @@ int migrate_pages(struct list_head *from, new_folio_t get_new_folio, count_vm_events(THP_MIGRATION_SPLIT, stats.nr_thp_split); trace_mm_migrate_pages(stats.nr_succeeded, stats.nr_failed_pages, stats.nr_thp_succeeded, stats.nr_thp_failed, - stats.nr_thp_split, mode, reason); + stats.nr_thp_split, stats.nr_split, mode, + reason); if (ret_succeeded) *ret_succeeded = stats.nr_succeeded;