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 3A006C2BD09 for ; Mon, 1 Jul 2024 08:31:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A46CA6B0092; Mon, 1 Jul 2024 04:31:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F6AC6B0095; Mon, 1 Jul 2024 04:31:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8BDFA6B0096; Mon, 1 Jul 2024 04:31:57 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6C0EB6B0092 for ; Mon, 1 Jul 2024 04:31:57 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 1209E1C1449 for ; Mon, 1 Jul 2024 08:31:57 +0000 (UTC) X-FDA: 82290515874.21.F172923 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf18.hostedemail.com (Postfix) with ESMTP id 17BEE1C000F for ; Mon, 1 Jul 2024 08:31:54 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719822699; 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=9YN+SiBU4XyHfgElPWUO1tbUvfWkJUUHNGZgpcvkXmY=; b=ydNSyR0lg/nQWU2fkoMk0J/Kdn4LRByCva77JD7Fk/kWBksa2D2KBu48/10/UvfAmDMRER AyEN2eMRIMksJatNzAuXtLhA0NfNCS+tUGLgh23zWVpEiH9uhPx0k/UEXNDtZ0tZQP+vfo mChiXUE+YEGXijsNt7kXBT9vmu4jPRY= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; spf=pass (imf18.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719822699; a=rsa-sha256; cv=none; b=o5CxGVP+ORGNmSMuTwBqZgOnpwgIlEJag8gXpLyUXXgvI90kwbf2S0zPhKr4QynRBiBZ8d oi+Sg9M6c9EoHvPTnGuZ3bN/tREA5GfQoJ4udgHHURQb3RFXsz27hdtp1yXtp00Lia/Dg6 ERA8/IYpB6kHZmR/tF0gp9vxlrr4l40= 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 34DBF339; Mon, 1 Jul 2024 01:32:19 -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 9F4103F766; Mon, 1 Jul 2024 01:31:52 -0700 (PDT) Message-ID: <13dcf4be-8c5f-4697-adc1-b68c3da82d78@arm.com> Date: Mon, 1 Jul 2024 09:31:51 +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 , akpm@linux-foundation.org Cc: 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> From: Ryan Roberts In-Reply-To: <20240628130750.73097-3-ioworker0@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: xcfx5s9gjumzu3w79yig9qm6kdrfgiyj X-Rspam-User: X-Rspamd-Queue-Id: 17BEE1C000F X-Rspamd-Server: rspam02 X-HE-Tag: 1719822714-754351 X-HE-Meta: U2FsdGVkX18xeKrjoqzacN9ttyzIPFJLB4Z6+4YBxvXfpa3HqJSs57IwzpbVatYleilUmo2XOXA999Wd7ysgHJZP2GKe6g5VvBs7LzxtZodU77PJpvCjeQAPjX7YKMueJac0lrRF5v68x196sjZJdto/sZw6UhJYV71gGLfZGe1X8cK8FTRqd7dUNicjVnjXePnt9bn1RIIDP6JWMUTzbBdt/xEwF1G/UvICER25BLcbbm/ej5EVTWKXW1Aw7NiVKyJEIiGc9G0FSvzN4Uy0cZT+RlpT1sZ/UhL0NeREYwf/qtxb7qAZftec5C938lXJ7UFwUkrI3YoewQEfdNWlBelVyS6F7mu5WruX6rdxYL8jdQIraCdBZwrULJUqq2eR5mXgn9lqQdIvwE1+nLiixD0R29yBwdF0VDA8q1hoMPTI7JOvRV3aha8oJ41l2fBz6lbOqAgpstZAs85yrHWP21ft47xguQzOVy8FQCicgzGncEFrm13mJW3Gdir94V7izKLsrIsCM66S+AmwL2v87pbo1H5MAuZuBFHAt7BYb8jfy29IAw/1AHYsDUwZy4SNqPfAwYWy5cZRqMaPjSi56W1ECEfsnIIgoIJTRk+79XhHBZQvtlYScWtAvF1XRRX9+0zIrI63Noq4XgTeFCT2u6Bo4SpvuN/jvQTPJ5px5Y+1bY8Iuxn84SsBAWAyJWZ1nLjbcuSuRHODFDiq8hZU7vocDOxE3nqXbupQWdHHw4e9Ls5Ndj8fyTQ1qFgGuqQd2L5J8Nw/f1g8wkG/ztzuNldKBsbTW0t3VUDiyB3sjijDrvvCbYN/SJiaNlweNIKujFF9TR6UQgspkCwBmSr9S4kVv4XxDMb5ySAfE7Wd+ZpMjKXI9kRgrSmeNqzBYMPdTWy6KjZjWEekLXLSMfiUcaka7ZNEwwK2+CUgQW/83YW8bDJqtXWBJCBr3tN0VT7c4YykixtyPsd7Z34snhF OHP4M2Tw nL554ypsdqTt0UHHkBWc9QQog1slKihKS+ee0jOSdR6+C+l477S4+Zwu3/9iPiWHBAs4pxH9v3CzmRD5ZTt9vYd50va0vP0sGdLEnpXa8OnaXNl88PaKzmXniryvEUxdCX8qoig9c3JInakxjJ+GVJh/8p09HjptDwijZH0rEUFrB6O3zosFUE/6VbYpymbKJ7N8L 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 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? > > +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. > + > +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