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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00452C2BD09 for ; Mon, 1 Jul 2024 11:47:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7F7CB6B0088; Mon, 1 Jul 2024 07:47:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 780C76B008A; Mon, 1 Jul 2024 07:47:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6214C6B008C; Mon, 1 Jul 2024 07:47:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 4198F6B0088 for ; Mon, 1 Jul 2024 07:47:05 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id DC16EC0EA2 for ; Mon, 1 Jul 2024 11:47:04 +0000 (UTC) X-FDA: 82291007568.22.A80CA22 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf08.hostedemail.com (Postfix) with ESMTP id D389C160026 for ; Mon, 1 Jul 2024 11:47:02 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf08.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719834399; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b5hTAOsWB6wyA83ztwmn1EIsH18Md/CaRyGPGGOGMrE=; b=dBCiKQ2aDAs4/NDEVk6qURFsN2h80NbnexUG8Z1cbUQoV+tmRS6yXS4IS5q5+GahIYcEkt 7Ot5W/7x7MXnE8B8hyTH/sSqJ9DYrxKD3lbqbz0IcAfOyf6s2plW1iQiQ+izcZU+JY2DhV XUtVPMqADLY1mT15LwzL6RHSJpmOWCk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719834399; a=rsa-sha256; cv=none; b=CsOGBLRvB0R+8gMZ1HfT8nW/H+l/eoCUaia5aRJOKDjqxyfuvfEx+ewrBiymbSsT/C7Zrp AXsfq35sA++K4qifrsmnJPJoFPGCN2H1Q3q/a4V9Hr3kAH0HUs8gMTGqQDqFVxSm4AWcEY 9P1JQ3/ZPzne/j4XtMJ4jdwQiQ3Y+MU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf08.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AC80B339; Mon, 1 Jul 2024 04:47:26 -0700 (PDT) Received: from [10.57.72.41] (unknown [10.57.72.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A8F63F762; Mon, 1 Jul 2024 04:46:58 -0700 (PDT) Message-ID: <9bbbf8be-a197-476d-b491-92c9e31e8119@arm.com> Date: Mon, 1 Jul 2024 12:46:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/2] mm: add docs for per-order mTHP split counters Content-Language: en-GB To: Lance Yang Cc: akpm@linux-foundation.org, dj456119@gmail.com, 21cnbao@gmail.com, david@redhat.com, shy828301@gmail.com, ziy@nvidia.com, libang.li@antgroup.com, baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mingzhe Yang References: <20240628130750.73097-1-ioworker0@gmail.com> <20240628130750.73097-3-ioworker0@gmail.com> <13dcf4be-8c5f-4697-adc1-b68c3da82d78@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D389C160026 X-Stat-Signature: mr9rhi4okjzajzd3k7uo9ix5sezoh49n X-Rspam-User: X-HE-Tag: 1719834422-340467 X-HE-Meta: U2FsdGVkX1+9SRH0B3VvwTLTgfSY9xhJ9LhdNurLVqvhaqroqRuYfHjJ27aZbo7oWmtevQ02GzltKs1mE8HsTivkM/eXB/RLWezgsPvfOmrUTrFPIlKAnqECIktdISraDEIY+mpWfcyAKrc1zABgWh5DmKQQKPKSvwegkDAuLK5r1GhAAFL/KGg7PxSW1PFBvh5A7srNPiWtk/yWzptmppnIiy1Buj8O5nWpRii0MN0Vz39UXaZjQYV/Bz17wKAMRnVWP8lxWLSJXLVxyNL3CSRPtHmJvvrdL61Hnex1bocgQVZZrrZBQNB4MTg9RccL0hFPA8s7yhudV+0d44dGzfEdhyy3EjHGWGlYQMbwb+9VpbmG1GmgSufHNQluMGokvipWUmjkv4TkPR3G1syZwkh03c9S82+Z+tOVMXJySl+l0RzRWqGf1gmoICNxuVImNWhFtJzV/6/h0SK8547IOxReCLMHBeyOrxNjfci8vGuT0p3aSFbv/iQwuDUkyBMKiFNKaqd+9TEr7z8gjKV6U7ZL/omjHSccZuKLUycyuVztI6bEsJgdK9D70eLG3CXoiiOQNK1/rzQiOoOpcbhrTRSEnP2Ioz52/9MuDFjFrRofuP+HeVOaWCv8/pqwTsBr2otKGx8BxmcjYSzvOAcy4VxiFyU+OjRRPilJswcSBT6fihkrxGM6Vooh0VQSf3kbfmQm8G/ofSA8x+dbfoT+7yDfH/7mkAgnAySUXS2eW8CPWwiurmH+2uDsTbc84cuCv5VVYyKvSRb3W2uzXPOcSKEpLlf3bPon4+2BQKYOobV6f/eBprSZOJQPIZj7tBWWYGibAHwBQClpuH8ZHTVf4AQFeQLmovaIpsuqXjP41qSJBEh3SurQlWbf4NXYWVwmZ2Zldp2wvGAca5PuAWL/cyfsE9IgfArLHnb9xt9YzF+ORDe29DcQ6iJCx7OHCPPbrv3OCtqsJBpH9ZqTe8R ZUnQni9/ 0WcE7dBztiB8aUUVF8lG1tn7IQpulFIMKzTuI6oQ7ofW9tSWnOIvUMvlG+pwAK4Ne2HA9Hvh8X9rBwuKHNC3iJi75Ya4/qcTu1RaJhLZWiQXn1QbbCfZ9Nz9F4wDXSWtp/sUY7pQr7tiR80zNnuUiq7Xc6mIUsNCurWGiN88Vn376xg5ff/5h/dUC7NpYMP5L2v1Tj4d9rgDSigb97ulhD4C/6RPQAQBZVXBm9yUg+Fy+Aesk0Agor62wj2wMBm96NijApPKJBgxrJoWbqkZ1R3fBzg== 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: List-Subscribe: List-Unsubscribe: On 01/07/2024 11:50, Lance Yang wrote: > On Mon, Jul 1, 2024 at 4:31 PM Ryan Roberts wrote: >> >> On 28/06/2024 14:07, Lance Yang wrote: >>> This commit introduces documentation for mTHP split counters in >>> transhuge.rst. >>> >>> Signed-off-by: Mingzhe Yang >>> Signed-off-by: Lance Yang >>> --- >>> Documentation/admin-guide/mm/transhuge.rst | 16 ++++++++++++++++ >>> 1 file changed, 16 insertions(+) >>> >>> diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst >>> index 1f72b00af5d3..709fe10b60f4 100644 >>> --- a/Documentation/admin-guide/mm/transhuge.rst >>> +++ b/Documentation/admin-guide/mm/transhuge.rst >>> @@ -514,6 +514,22 @@ file_fallback_charge >>> falls back to using small pages even though the allocation was >>> successful. >> >> >> I note at the top of this section there is a note: >> >> Monitoring usage >> ================ >> >> .. note:: >> Currently the below counters only record events relating to >> PMD-sized THP. Events relating to other THP sizes are not included. >> >> Which is out of date, now that we support mTHP stats. Perhaps it should be removed? > > Good catch! Let's remove that in this patch ;) > >> >>> >>> +split >>> + is incremented every time a huge page is successfully split into >>> + base pages. This can happen for a variety of reasons but a common >>> + reason is that a huge page is old and is being reclaimed. >>> + This action implies splitting any block mappings into PTEs. >> >> Now that I'm reading this, I'm reminded that Yang Shi suggested at LSFMM that a >> potential aid so solving the swap-out fragmentation problem is to split high >> orders to lower (but not 0) orders. I don't know if we would take that route, >> but in principle it sounds like splitting mTHP to smaller mTHP might be >> something we want some day. I wonder if we should spec this counter to also >> include splits to smaller orders and not just splits to base pages? >> >> Actually looking at the code, I think split_huge_page_to_list_to_order(order>0) >> would already increment this counter without actually splitting to base pages. >> So the documantation should probably just reflect that. > > Yep, you're right. > > It’s important that the documentation reflects that to ensure consistency. > > How about "... is successfully split into smaller orders. This can..."? fine by me. > > Thanks, > Lance > >> >>> + >>> +split_failed >>> + is incremented if kernel fails to split huge >>> + page. This can happen if the page was pinned by somebody. >>> + >>> +split_deferred >>> + is incremented when a huge page is put onto split >>> + queue. This happens when a huge page is partially unmapped and >>> + splitting it would free up some memory. Pages on split queue are >>> + going to be split under memory pressure. >>> + >>> As the system ages, allocating huge pages may be expensive as the >>> system uses memory compaction to copy data around memory to free a >>> huge page for use. There are some counters in ``/proc/vmstat`` to help >>