From patchwork Wed Apr 24 13:51:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Yang X-Patchwork-Id: 13641893 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 EC234C07E8E for ; Wed, 24 Apr 2024 13:53:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BC2C6B0209; Wed, 24 Apr 2024 09:53:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 76BBE6B020D; Wed, 24 Apr 2024 09:53:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60B8E6B020E; Wed, 24 Apr 2024 09:53:01 -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 3D11F6B0209 for ; Wed, 24 Apr 2024 09:53:01 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 01B6EA10C0 for ; Wed, 24 Apr 2024 13:53:00 +0000 (UTC) X-FDA: 82044566562.27.45EEC01 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf15.hostedemail.com (Postfix) with ESMTP id 1F225A0024 for ; Wed, 24 Apr 2024 13:52:58 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=V5N3wggw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=ioworker0@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713966779; 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=tsoxQhAv5AuN2yRGgG+xM3faRIluQo8URp1tUZQwKu0=; b=as6dA6sXl4ssHivkO5Aawu8EPaOMxOAkVzrOZGl/fBW44cRvIqDy7u+9SSHAR/v6AQs4r1 sVQw22ywZVnE6btQG9HAo3IuM85ICGqJ7Mnfce0ht1GB5oeNKneqSBXvZRoxBv+rxTgJa5 mXkzX/GvRLvPaKA55+cm+1CIrLuLiLI= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=V5N3wggw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=ioworker0@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713966779; a=rsa-sha256; cv=none; b=RvaCumiOGVsVRL5EiJrfGpqq2UVpbt4TxwSLq0Dvpl4tl1lAT7DGF2OXl/IuaUIVuewS09 5/+2gbAspdrZd4QeMXxx6IC0CZGT56DV/PBtyWo7rpg82EEh19aOoa3/wV5FT5Q+ZT/cNl PrC82CR37b+qlRrmhgeXR9bU/QwUUZQ= Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1e834159f40so51611665ad.2 for ; Wed, 24 Apr 2024 06:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713966778; x=1714571578; 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=tsoxQhAv5AuN2yRGgG+xM3faRIluQo8URp1tUZQwKu0=; b=V5N3wggw9YUUl0Gb0+aFCbOtCxC29dFWl8yxWIT8RNr5AHwTCJhKwUK264AAr+Jl3/ NPzyz4qdkNX4j8wUtbd77mVSRLyC8XktKsv/UvSEVi0JKpal32YCWHXziXHmCiLGOI7u pAWLvpPhaw+/2DckJYs4sf3gUaBrzLejX29B3po5YM4FWLBHOZj3A+vNBIOCWoeQkICn 9jkDXSrXAkR9QkBvg1w86ccjpH5H8zNmbUaCw+ei56x9r0VShkHmJ7qoessJ7a4zOZEC PAnG3K1ZvP/ffO5QNot1PNBS1Wx+LkCTKWuMX/0eNuyxIqq7MYf4Z0yJuObdREwShDI6 CVPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713966778; x=1714571578; 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=tsoxQhAv5AuN2yRGgG+xM3faRIluQo8URp1tUZQwKu0=; b=vwlR2L7Cxk9IdZmSjGDpPlWT/YQKbvE4Mhf/yuV3lSbH+bef8vS98ASah1GJnrRyXH X9ODcRREF2WeuRIaLM+iamQ7Ecz8zeYiV7T9+urP2Z3EB0IGuLEltZYknKtpNTy0zlr4 y6DgUlBarjNVbVXZC35RjCHPip2SDJyAQq3Jf0FdjEbWqxNz2ou2qS8iF+5ZSd6O0l3w xXRFf0MHYIgoOJpDrLqPfqMwtPLKOkIgCyV5/3fd+H6bucW7QIylSuAcJ7hEtBpMMSHL zeZDNue8o2tpRFxTskzJv80mjvnZHiAN6HnvFoDK90/TYulrTc4g2zsUlzOu4qemTwop dbaA== X-Forwarded-Encrypted: i=1; AJvYcCXo9Fg8QwDhyhb1l7+MZXQ92404mScNdjcaaFMTyVfp/qe89WWV6OCTnqj24Kb8VpjzVkVlFR0N9w9mNxByeUQ53Aw= X-Gm-Message-State: AOJu0Yy14Q76lN8oAU/pSgf8SXTt0mfMEEkm137NiA0rrxXhUfmU8ZCQ wn1S6URyGklF1m7Y0srFlNDVdbE+MWxa+4EIRFkcJgGL04mLNyTH X-Google-Smtp-Source: AGHT+IHx08m/+g1QPinEVulyhxIIRDK2yi5NXjlI92ZLNvIp+cKZpaef84hTpV7qm1gN58ET7kSVlA== X-Received: by 2002:a17:902:d34d:b0:1e8:674b:d10f with SMTP id l13-20020a170902d34d00b001e8674bd10fmr2677214plk.41.1713966777772; Wed, 24 Apr 2024 06:52:57 -0700 (PDT) Received: from LancedeMBP.lan ([112.10.240.252]) by smtp.gmail.com with ESMTPSA id c6-20020a170902d48600b001e89c729843sm11140235plg.228.2024.04.24.06.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 06:52:57 -0700 (PDT) From: Lance Yang To: akpm@linux-foundation.org Cc: 21cnbao@gmail.com, ryan.roberts@arm.com, david@redhat.com, baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Lance Yang Subject: [PATCH 1/2] mm: add per-order mTHP split counters Date: Wed, 24 Apr 2024 21:51:47 +0800 Message-Id: <20240424135148.30422-2-ioworker0@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20240424135148.30422-1-ioworker0@gmail.com> References: <20240424135148.30422-1-ioworker0@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1F225A0024 X-Rspam-User: X-Stat-Signature: 8s1osroakqjcrpkuzreu7rywri96y5rr X-HE-Tag: 1713966778-212393 X-HE-Meta: U2FsdGVkX18G+AdLdN6WBVijPR0Zvs/tV0HNgYSeA+A8SitKrOUweaFxbZvpD5nuZWCISdWOoycUVel7Uhrc9cL4i0Cin+Pjaa1Gp9ywZgKu2dMRKNSDuDtxmiHgxYOoeSDMP2PPpIk0oRwddqQk6XcMK5huW8JLgTltPDptis3/9f1MxaRtBs2mM4TnI4dP5pYAhJejznxYFv0+LiZKS83CJ6GxIRKiTzm+OIWQB9XVzkVKA9Sam3LL9b3tx6jQAPotQA2GMCeUmGiyGPrP2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Mb4r5lQB+faEAjuLZN00AjarNlXd867GQRHeBCDUNmTFYjlXHwlk4I99Zz79O20OiJ7Ot1FgqhCULsBG+i 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: At present, the split counters in THP statistics no longer include PTE-mapped mTHP. Therefore, this commit introduces per-order mTHP split counters to monitor the frequency of mTHP splits. This will assist developers in better analyzing and optimizing system performance. /sys/kernel/mm/transparent_hugepage/hugepages-/stats split_page split_page_failed deferred_split_page Signed-off-by: Lance Yang --- include/linux/huge_mm.h | 3 +++ mm/huge_memory.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 56c7ea73090b..7b9c6590e1f7 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -272,6 +272,9 @@ enum mthp_stat_item { MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE, MTHP_STAT_ANON_SWPOUT, MTHP_STAT_ANON_SWPOUT_FALLBACK, + MTHP_STAT_SPLIT_PAGE, + MTHP_STAT_SPLIT_PAGE_FAILED, + MTHP_STAT_DEFERRED_SPLIT_PAGE, __MTHP_STAT_COUNT }; diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 055df5aac7c3..52db888e47a6 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -557,6 +557,9 @@ DEFINE_MTHP_STAT_ATTR(anon_fault_fallback, MTHP_STAT_ANON_FAULT_FALLBACK); DEFINE_MTHP_STAT_ATTR(anon_fault_fallback_charge, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE); DEFINE_MTHP_STAT_ATTR(anon_swpout, MTHP_STAT_ANON_SWPOUT); DEFINE_MTHP_STAT_ATTR(anon_swpout_fallback, MTHP_STAT_ANON_SWPOUT_FALLBACK); +DEFINE_MTHP_STAT_ATTR(split_page, MTHP_STAT_SPLIT_PAGE); +DEFINE_MTHP_STAT_ATTR(split_page_failed, MTHP_STAT_SPLIT_PAGE_FAILED); +DEFINE_MTHP_STAT_ATTR(deferred_split_page, MTHP_STAT_DEFERRED_SPLIT_PAGE); static struct attribute *stats_attrs[] = { &anon_fault_alloc_attr.attr, @@ -564,6 +567,9 @@ static struct attribute *stats_attrs[] = { &anon_fault_fallback_charge_attr.attr, &anon_swpout_attr.attr, &anon_swpout_fallback_attr.attr, + &split_page_attr.attr, + &split_page_failed_attr.attr, + &deferred_split_page_attr.attr, NULL, }; @@ -3083,7 +3089,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; @@ -3262,8 +3268,10 @@ 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_PAGE : + MTHP_STAT_SPLIT_PAGE_FAILED); return ret; } @@ -3327,6 +3335,8 @@ void deferred_split_folio(struct folio *folio) if (list_empty(&folio->_deferred_list)) { if (folio_test_pmd_mappable(folio)) count_vm_event(THP_DEFERRED_SPLIT_PAGE); + count_mthp_stat(folio_order(folio), + MTHP_STAT_DEFERRED_SPLIT_PAGE); list_add_tail(&folio->_deferred_list, &ds_queue->split_queue); ds_queue->split_queue_len++; #ifdef CONFIG_MEMCG From patchwork Wed Apr 24 13:51:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Yang X-Patchwork-Id: 13641894 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 5C219C10F15 for ; Wed, 24 Apr 2024 13:53:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D87746B0260; Wed, 24 Apr 2024 09:53:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D37696B0261; Wed, 24 Apr 2024 09:53:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB22F6B0266; Wed, 24 Apr 2024 09:53:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 99CE06B0260 for ; Wed, 24 Apr 2024 09:53:03 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 55322140861 for ; Wed, 24 Apr 2024 13:53:03 +0000 (UTC) X-FDA: 82044566646.11.46C40D9 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf22.hostedemail.com (Postfix) with ESMTP id 5565DC000C for ; Wed, 24 Apr 2024 13:53:01 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GsCSFBOI; spf=pass (imf22.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.214.182 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=1713966781; 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=8eSXSlkmErEctEhBOKS7ewxnrkbMKKDa4aGhbCp7pwQ=; b=AJ9F0VtYxneoQJtKnTX9S46oTS3Zs1ewgZMLjdUQOYpDHSdnmNL1aEwsEbghbPdDoUrDbu IoUhsEWD0TMpKd7cDw+mVW5ZD32iaVoE5NPILzR/hfpCDajB3y5WYxh5ZVmBSONdOAKkj8 lT4HB9f1wR15Ocqb6W5SXZwvBXR4s/E= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713966781; a=rsa-sha256; cv=none; b=fCQDlnBzQvnuKq6NewzhxSYeRYLJpcOopsoyBpvICY2YpqBYN+pHG/4ijRHqKXgX+zO6cZ 2rGCxJS7UIDfD4u3A/c0X6363e7lRE6ydw1cmZYXGfbZoS9WJQZDUqorDT8Jw5+mKfjLwC Rg115TKMKqR3yJjniH+KDUtSOb9m7yE= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=GsCSFBOI; spf=pass (imf22.hostedemail.com: domain of ioworker0@gmail.com designates 209.85.214.182 as permitted sender) smtp.mailfrom=ioworker0@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1e40042c13eso50744545ad.2 for ; Wed, 24 Apr 2024 06:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713966780; x=1714571580; 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=8eSXSlkmErEctEhBOKS7ewxnrkbMKKDa4aGhbCp7pwQ=; b=GsCSFBOI9Ppowx4odicpMhnVLgqb8lahNmcskNV4saS5gXMHadAQRluwkePrzgNlZK dJP3K1laNCongAc8arEUxofk1fGJ85uWOmNUy3Tou0e3hipi4RDFgtOs5cv16a+d2x2B ZXKh7hg79ZH4eIQ+GA1g/G5CnFjS9ZcGcWtzxzw93lI4vQMcZDKioeFRXWXu2W6GJfyW fs9jAdg2v/KFwB9KU/lLZqIItpKpGfCrlvs+mXYWWsyXJyht/M8vSmJl2yIOynda7lgH mdjn/mKPtGgsj20Ap/qpvILQVySe1+fDY2Ng9vwyXqVNlgY6+OkK0rgCX5XSSbbtEBb2 3lKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713966780; x=1714571580; 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=8eSXSlkmErEctEhBOKS7ewxnrkbMKKDa4aGhbCp7pwQ=; b=IlhoUzq+FO7IVFRLYFAwWSdkMadvTrM8JOtoWmw7bLdz2ub8Fh0BpR33TmuvbZFP98 zD4rURpqH/GFigfRkR4G3QWkWSPK+e8Tb1IYq8heQ4+qJ+sAD2c51IDfGIQcmi63jBSS FFGIQSfAUyWmMYDFNDP06fAqRDY0svf5Fk8Oai4FqIFBVleNh2LmBcWFQaoBEiNbDwI0 wr0RXZO6UJpe4N0WEP7q64zC8FifTyqsjPsUSu7YrdRodLUfVLuwX7NarmxJAQfWvgeq Yuj+h++86x3lTOXgWr/t8paEc36qGeamrZToqw2he8dS6tE00tKGi82ZW5cPIRae6jBS H3oA== X-Forwarded-Encrypted: i=1; AJvYcCUzRzXfMmi8xd7GR2iAYWw0dfK68ubILmzy8upZSpZNb5UnQSWs4MQ4uZPWLFRWqtVa1gyPPr7dsffjkfnCNi0Si0s= X-Gm-Message-State: AOJu0YzhrCUuAcZ4AzRuj2LNOxbny/f2ET4RlbMGPHO90OqPl3MmMIRB VsiNO1etbFwE+T7TtCJx6A+e4i5LSQ9oV0IimAKPqBI1GOhhWCE6 X-Google-Smtp-Source: AGHT+IFpq8EsYQokhHELiawk+TzB5MqVAd/PCoqMESyI7odQvHSf7n7b5/uplpAEizjapcocQJvAIg== X-Received: by 2002:a17:902:ecd2:b0:1ea:9596:11eb with SMTP id a18-20020a170902ecd200b001ea959611ebmr406501plh.60.1713966780250; Wed, 24 Apr 2024 06:53:00 -0700 (PDT) Received: from LancedeMBP.lan ([112.10.240.252]) by smtp.gmail.com with ESMTPSA id c6-20020a170902d48600b001e89c729843sm11140235plg.228.2024.04.24.06.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 06:52:59 -0700 (PDT) From: Lance Yang To: akpm@linux-foundation.org Cc: 21cnbao@gmail.com, ryan.roberts@arm.com, david@redhat.com, baolin.wang@linux.alibaba.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Lance Yang Subject: [PATCH 2/2] mm: add docs for per-order mTHP split counters Date: Wed, 24 Apr 2024 21:51:48 +0800 Message-Id: <20240424135148.30422-3-ioworker0@gmail.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20240424135148.30422-1-ioworker0@gmail.com> References: <20240424135148.30422-1-ioworker0@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 5565DC000C X-Stat-Signature: shjsbw19oqnkjx4sun8cojfpe8yu4cgd X-Rspam-User: X-HE-Tag: 1713966781-67014 X-HE-Meta: U2FsdGVkX1+/o2rfE/dzwMc8fM5KhKQRsA+hvP7685mwBZFAzmVDcGew+OfamQhjy1+v72gKOuxWBssXtkdpkCvy9/joRxZLuotIi+NQLT/tcKjVUPhoozWt204iHPahXDDtC6y+TCe0yot8u8SmwJZvGp82KTJGsWApcIyBbFWBHUMsp0FNU63JKS1aNxg1r9t2SRxDu+izYqFFofHXizcEjUFaW8pUFYC8zXJ/bKpgz+DtkK5ImEUOpXw9/FsuiSLosoU1Ypelr1WygZ1ZFhRDchzyW6QqWGclud6LLaq9hr0ot+wfDx3N2lgEphLwHqXcj5wvjOIcJ/CHp4PhjomM46eVwkVunsXhVRQDeml8luJQmj9ufw/sCSkUdGrfqI1jLFkcj6+mmQgosg3dv78YY4OkLIFeTOIEG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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: 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 f82300b9193f..35d574a531c8 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -475,6 +475,22 @@ anon_swpout_fallback Usually because failed to allocate some continuous swap space for the huge page. +split_page + is incremented every time a huge page is 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 all PMD/PTE mapped with the huge page. + +split_page_failed + is incremented if kernel fails to split huge + page. This can happen if the page was pinned by somebody. + +deferred_split_page + 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