From patchwork Fri Jun 28 13:07:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Yang X-Patchwork-Id: 13716110 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 9DF81C2BD09 for ; Fri, 28 Jun 2024 13:09:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0E6726B0088; Fri, 28 Jun 2024 09:09:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 06E116B0089; Fri, 28 Jun 2024 09:09:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E02A36B008A; Fri, 28 Jun 2024 09:09:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BAECD6B0088 for ; Fri, 28 Jun 2024 09:09:13 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5A0C416030F for ; Fri, 28 Jun 2024 13:09:13 +0000 (UTC) X-FDA: 82280328186.08.0855653 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by imf18.hostedemail.com (Postfix) with ESMTP id 4B2DE1C0017 for ; Fri, 28 Jun 2024 13:09:11 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=WlOCFmyG; spf=pass (imf18.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719580141; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pA8e/eG8oKstNM7/17OixM+41nIGNrDwvlLD106HjE4=; b=Jue67pebxzPuHDAqWVCz0vqw4PTbm0s5PoJQVZldTxVBozZ4EzWSGpg5ySY8A/XYUl1/7O 6qT3DFuLPk1k/csvgDlcovqOPWRE+Z6DHt8mlrEnwiNBN+RoMt0i+7Z15aeJBOHMZqZB17 9vYBvM8xBb7fH0rHiOuW2pznY3pXQx4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=WlOCFmyG; spf=pass (imf18.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.210.173 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719580141; a=rsa-sha256; cv=none; b=5WxjWtCK/2nhdgM2WsoeEcKNc1Pe4BB0Raj6IAxsYUTGMdvHuioe6e3OyPv3TrEns6S0N2 fRvuZyU8vwgFtCyXjmU67ACWd3fBslY2V7LqPwrSjQ27dHpJ3shnxCYdkApv88E8eQP1Z8 yefxjqhJYEfAk7VJj/RgjazVXDD4Hes= Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-701b0b0be38so481309b3a.0 for ; Fri, 28 Jun 2024 06:09:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719580150; x=1720184950; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pA8e/eG8oKstNM7/17OixM+41nIGNrDwvlLD106HjE4=; b=WlOCFmyGXjbTvYsaosxjmmxwTJt+z5SHe15QjXd5+MNolT9u1FZET53GvyHOV/seBu bhx9hp/2NlFbk/J4Dl+tYz9w7GqBIqoezgk78WBhPqEx+jrTVkXl/KV5ykKyLymp3cM2 YQgqOgXFUhjwgJudURv6aF1NoiZeAYCJ7U/K/QUgeaDCHza5TgDVlD5jPpZAivvgWdiO J1QZXjzF84PO5TMPLW8V00T9dCpjix9QjmnrXQ3wyv925IKZekm/BgprKS0fAVV8uVbe TIQjcZN+Tg8VfspQNOyhQ47rSPBXl1FYi7kyWIG9bPgQcRaN6NEf5j6OZglysvKRAoJU qiag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719580150; x=1720184950; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pA8e/eG8oKstNM7/17OixM+41nIGNrDwvlLD106HjE4=; b=iiXxDeH6rDyTMqc+uEXPXbQtJlUZcCeHh3IYJmoT5h4yXmivrkd8a4zB+V9hLjEq9r xgZhSsmoLc/rcHZz74cY5UEq7G3TNqsxdZq3xKDlhpcupfIttE+IXQId5vce90tHRCo6 YqKkJJX5PPqH5UxaVcLm8M6q0A8AjumELKApnEyNdHNb+NGV37qqAa+ak4Lhw5ktuTi9 jk0jSW1OMjxw4d4L0ZhHtJ9UOJhPCD2MgtdRWzYYJYyt/UNz3sg5KomL2g/xJlb4/pWk h9DW0Jr6c6APD2PnxRnnUvZW0phZH91ecVa4pLBMG7w8ImFj8INkI23GiUl+RlbDtIFa ayZA== X-Forwarded-Encrypted: i=1; AJvYcCVFC2QmexbY4mNlEYEzigr+NPzqvHygadJOh2Oov6L9jdNgAWPB7ScKFqND0vWERSxmvtDfWj19n60Efx8OL67km6A= X-Gm-Message-State: AOJu0Yz3qUYMZn1rQEDBDLnT9MWDLmH1iZdwBQ0N9WuKd10i1FV/ww0Y wTZbqI9m29fMqwxqFAkCbFL310BXnCwcTYblOwKmAu+OFjixMYNI X-Google-Smtp-Source: AGHT+IFjbkgnF3EAdZd/5nvVUSzeFKuPrDEySNvAscHEob4ZAfU8Zv04k82jTF9h3HEfGazGu1kgAQ== X-Received: by 2002:a05:6a21:998b:b0:1be:c58a:7433 with SMTP id adf61e73a8af0-1bec58a775emr9386756637.59.1719580149845; Fri, 28 Jun 2024 06:09:09 -0700 (PDT) Received: from EBJ9932692.tcent.cn ([124.156.216.125]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7080498946bsm1526102b3a.200.2024.06.28.06.09.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 28 Jun 2024 06:09:09 -0700 (PDT) From: Lance Yang To: akpm@linux-foundation.org Cc: dj456119@gmail.com, 21cnbao@gmail.com, ryan.roberts@arm.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, Lance Yang , Mingzhe Yang Subject: [PATCH v2 1/2] mm: add per-order mTHP split counters Date: Fri, 28 Jun 2024 21:07:49 +0800 Message-ID: <20240628130750.73097-2-ioworker0@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240628130750.73097-1-ioworker0@gmail.com> References: <20240628130750.73097-1-ioworker0@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 4B2DE1C0017 X-Stat-Signature: onaqj7t9uanpsup69wsiebb73j1um5x9 X-Rspam-User: X-HE-Tag: 1719580151-8490 X-HE-Meta: U2FsdGVkX1/xF5kxymu0/ZCMxJLjA3r3hcv7MSWX01kDoDk0wlYnkxM7Za6xkQC/P20QZmVpI7H99sNAAq8ZxJ1Bg+VgcbH2WPRg3iyEyi2N16KP7zLuGIlqwIe1SCQ79Ay51zLjzrtpwYg/SY/vNi+gcSnwVAmG+ax9OAUrFrzwB5nTLO1g1K81vOklygqB4+9lowzx+NA3R0iVCQD+6s4tLRSdHp9vjgtu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dU/LHAZ68vbpjgjmh2RWYMe3t0rN/Co54sJO0REjRmbFKTN2zw6JE3WxqwgiThQ== 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: Currently, the split counters in THP statistics no longer include PTE-mapped mTHP. Therefore, we propose introducing per-order mTHP split counters to monitor the frequency of mTHP splits. This will help developers better analyze and optimize system performance. /sys/kernel/mm/transparent_hugepage/hugepages-/stats split split_failed split_deferred Signed-off-by: Mingzhe Yang Signed-off-by: Lance Yang Acked-by: Barry Song Reviewed-by: Baolin Wang Reviewed-by: Ryan Roberts --- include/linux/huge_mm.h | 3 +++ mm/huge_memory.c | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 212cca384d7e..cee3c5da8f0e 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -284,6 +284,9 @@ enum mthp_stat_item { MTHP_STAT_FILE_ALLOC, MTHP_STAT_FILE_FALLBACK, MTHP_STAT_FILE_FALLBACK_CHARGE, + MTHP_STAT_SPLIT, + MTHP_STAT_SPLIT_FAILED, + MTHP_STAT_SPLIT_DEFERRED, __MTHP_STAT_COUNT }; diff --git a/mm/huge_memory.c b/mm/huge_memory.c index c7ce28f6b7f3..a633206375af 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -559,6 +559,9 @@ DEFINE_MTHP_STAT_ATTR(swpout_fallback, MTHP_STAT_SWPOUT_FALLBACK); DEFINE_MTHP_STAT_ATTR(file_alloc, MTHP_STAT_FILE_ALLOC); DEFINE_MTHP_STAT_ATTR(file_fallback, MTHP_STAT_FILE_FALLBACK); DEFINE_MTHP_STAT_ATTR(file_fallback_charge, MTHP_STAT_FILE_FALLBACK_CHARGE); +DEFINE_MTHP_STAT_ATTR(split, MTHP_STAT_SPLIT); +DEFINE_MTHP_STAT_ATTR(split_failed, MTHP_STAT_SPLIT_FAILED); +DEFINE_MTHP_STAT_ATTR(split_deferred, MTHP_STAT_SPLIT_DEFERRED); static struct attribute *stats_attrs[] = { &anon_fault_alloc_attr.attr, @@ -569,6 +572,9 @@ static struct attribute *stats_attrs[] = { &file_alloc_attr.attr, &file_fallback_attr.attr, &file_fallback_charge_attr.attr, + &split_attr.attr, + &split_failed_attr.attr, + &split_deferred_attr.attr, NULL, }; @@ -3068,7 +3074,7 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list, XA_STATE_ORDER(xas, &folio->mapping->i_pages, folio->index, new_order); struct anon_vma *anon_vma = NULL; struct address_space *mapping = NULL; - bool is_thp = folio_test_pmd_mappable(folio); + int order = folio_order(folio); int extra_pins, ret; pgoff_t end; bool is_hzp; @@ -3076,7 +3082,7 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list, VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio); VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); - if (new_order >= folio_order(folio)) + if (new_order >= order) return -EINVAL; if (folio_test_anon(folio)) { @@ -3253,8 +3259,9 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list, i_mmap_unlock_read(mapping); out: xas_destroy(&xas); - if (is_thp) + if (order >= HPAGE_PMD_ORDER) count_vm_event(!ret ? THP_SPLIT_PAGE : THP_SPLIT_PAGE_FAILED); + count_mthp_stat(order, !ret ? MTHP_STAT_SPLIT : MTHP_STAT_SPLIT_FAILED); return ret; } @@ -3278,13 +3285,14 @@ void deferred_split_folio(struct folio *folio) #ifdef CONFIG_MEMCG struct mem_cgroup *memcg = folio_memcg(folio); #endif + int order = folio_order(folio); unsigned long flags; /* * Order 1 folios have no space for a deferred list, but we also * won't waste much memory by not adding them to the deferred list. */ - if (folio_order(folio) <= 1) + if (order <= 1) return; /* @@ -3305,8 +3313,9 @@ void deferred_split_folio(struct folio *folio) spin_lock_irqsave(&ds_queue->split_queue_lock, flags); if (list_empty(&folio->_deferred_list)) { - if (folio_test_pmd_mappable(folio)) + if (order >= HPAGE_PMD_ORDER) count_vm_event(THP_DEFERRED_SPLIT_PAGE); + count_mthp_stat(order, MTHP_STAT_SPLIT_DEFERRED); list_add_tail(&folio->_deferred_list, &ds_queue->split_queue); ds_queue->split_queue_len++; #ifdef CONFIG_MEMCG From patchwork Fri Jun 28 13:07:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Yang X-Patchwork-Id: 13716111 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 0DE77C2BD09 for ; Fri, 28 Jun 2024 13:09:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9991F6B008A; Fri, 28 Jun 2024 09:09:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 954336B008C; Fri, 28 Jun 2024 09:09:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7C0C56B0092; Fri, 28 Jun 2024 09:09:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 5A4E36B008A for ; Fri, 28 Jun 2024 09:09:18 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0CB77120331 for ; Fri, 28 Jun 2024 13:09:18 +0000 (UTC) X-FDA: 82280328396.17.CC30AB5 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf15.hostedemail.com (Postfix) with ESMTP id 2CE2FA000F for ; Fri, 28 Jun 2024 13:09:15 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GZUw8PYg; spf=pass (imf15.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719580137; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8fwqZttwC+ZbW8FD7nFrsLap1fPEL7EKx4IYhcmZWAQ=; b=3JQIAFEcxzBWbwNqc3XCWpgA0tNLGT1ufdqBu7YJJ3IueppiMCmzXnWveR6Btj0IQu96wU IRd3vh5RbMBQ2AHDzK7htANl0LY3iuetIgN9lo0oUdOVbR67OUwl7PfKferEeUmoIVmDRD Hk0/Yc1ON9DGXj/vTzU9lH8sr7PLKws= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719580137; a=rsa-sha256; cv=none; b=AtBpc93oF3lYp+2u3q6PTfbxdN8XkVx0Ex8KX82f95AnjHv4oIQAlCxDP/ooEIKZ/i+o7/ 4+n6OSRbcG+JsdtJI0QbrypS5D45dmQkfyvA76XR7urtLZwJHAUlsCmXpnYpTdVIGbEIav uYGLwknlNV7MGxsZMcUylFyjwHr22ec= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GZUw8PYg; spf=pass (imf15.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-7066c9741fbso484003b3a.2 for ; Fri, 28 Jun 2024 06:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719580155; x=1720184955; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8fwqZttwC+ZbW8FD7nFrsLap1fPEL7EKx4IYhcmZWAQ=; b=GZUw8PYgx+nPS/fJzmknTHlZCuREwfcLTRbpXVRGfEfGgXdWPiW+lZcEeK1pAkkI4c Vw64Cqo17NnLBAroGL53IJl2rifs9Z2IK4109nWrjILne6Vup8xYGSGyTYPJNSGLwqSt vN/vZoJiSNNFy35w4NAnittKRP58Q6zO9CeDzflI7NoM59T23Nkzr/X/M+RS785c/BNl wG16ORxk2gc+2XBrzzwY0wUG62NDV/BAMhVj+Gcx1IfZCqzeOzi8xObw8ESVJjCSFlmU fBfKQjeyKB68xxG9dbVbsmkqcpa22iPzrzLB+G+pcF8iNeakuR+B94V75nm1lISpm579 3RoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719580155; x=1720184955; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8fwqZttwC+ZbW8FD7nFrsLap1fPEL7EKx4IYhcmZWAQ=; b=WM1noJlKZqaGVjhm+ydhJcIieZwfYS7uK7MVEZaAH8DCJ15u5QKsJnbuLVX6BNfuoR 4WLWr8rg+Mz2F2M+qhm4RTbcZQCU4ljz9KdL6lI1f2AjAqhcvuZMyDJKMuZjfKo6sVPu 9mkC+jAFeAyzuhf4dPBTBvmWhWcOiSy41Zn1nlElLGymjVyjDSJF3ntTr/Kcy3ZGKPgw /z2Q5wotQskMUdK2gkXQcowBMGxjnZ+9UbhrracExTt182peeQOwZgP+OP0IbxHo+Rc0 hHSxB0L/jZoczZQNA+/MVj1GNzwQPew1+rGVlLQoho+HvCIQfz6GM3OjU1pzY0F5xKLF aMKQ== X-Forwarded-Encrypted: i=1; AJvYcCU/eL2UXcUNjQpiia+QK4u9FkbAB4C4pzNMjMGvSmgSk4bqmj+fFX+zE+CHekmL44vnDwAnbizenym8cVQBOiXIbi4= X-Gm-Message-State: AOJu0Yw0QZsJgDokHm2hw9xPsNK43IP2hvhMR/wS+Wvjco1mVtTaEvwz XGcFG09K/qURRBIDeM7CokNAqnk6Pm68nqRnJF73GrXE3CrJMyQ8 X-Google-Smtp-Source: AGHT+IGn9DD50DNkYgejYoYqzKV81yY1R9ssvw1Q4pWXXVQ+kRqODZU3f60f4qTWaKwYCs6Dn2f3Ww== X-Received: by 2002:a05:6a00:3c94:b0:704:23dc:6473 with SMTP id d2e1a72fcca58-7067474dc86mr23147585b3a.30.1719580154982; Fri, 28 Jun 2024 06:09:14 -0700 (PDT) Received: from EBJ9932692.tcent.cn ([124.156.216.125]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7080498946bsm1526102b3a.200.2024.06.28.06.09.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 28 Jun 2024 06:09:14 -0700 (PDT) From: Lance Yang To: akpm@linux-foundation.org Cc: dj456119@gmail.com, 21cnbao@gmail.com, ryan.roberts@arm.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, Lance Yang , Mingzhe Yang Subject: [PATCH v2 2/2] mm: add docs for per-order mTHP split counters Date: Fri, 28 Jun 2024 21:07:50 +0800 Message-ID: <20240628130750.73097-3-ioworker0@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240628130750.73097-1-ioworker0@gmail.com> References: <20240628130750.73097-1-ioworker0@gmail.com> MIME-Version: 1.0 X-Stat-Signature: ingxmepqs4p9exupowm56x6tks4zmjgt X-Rspamd-Queue-Id: 2CE2FA000F X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1719580155-434329 X-HE-Meta: U2FsdGVkX19eBw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eettZN9gCaFPCe2xnfmjN1ncv2gTc3JgqiD2IcUU9ClA/Teh+J6Dl+JwtbimEtNPMmXT8FymkEXg6xT3mqJK8Q4YsiZPJirJ4WI4KbgmDGUS1Kk6/jbgcoT4sxMwqEEALCE3OfsBSrMFKM1mm/LPQ05Vb00ys4AcTEl7+CPjRSpK06VBEK+hCF+LliqQVZyw+0jx2kEUoldPJic+XSlZdolz7iafRTvIMaaZluzpUFLgtuJBY8/PPH4eQ3zs/xWy8IUFTCJm1wOSO0Yspw== 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: This commit introduces documentation for mTHP split counters in transhuge.rst. Signed-off-by: Mingzhe Yang Signed-off-by: Lance Yang Reviewed-by: Barry Song --- 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. +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. + +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