From patchwork Fri Apr 12 11:48:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song <21cnbao@gmail.com> X-Patchwork-Id: 13627660 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 0B148C4345F for ; Fri, 12 Apr 2024 11:49:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 937ED6B0098; Fri, 12 Apr 2024 07:49:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 89AB26B0099; Fri, 12 Apr 2024 07:49:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 713496B009A; Fri, 12 Apr 2024 07:49:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 503636B0098 for ; Fri, 12 Apr 2024 07:49:38 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id EBD81140E69 for ; Fri, 12 Apr 2024 11:49:37 +0000 (UTC) X-FDA: 82000709994.20.C617CE8 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) by imf06.hostedemail.com (Postfix) with ESMTP id 08BB318001D for ; Fri, 12 Apr 2024 11:49:35 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kenCTHg4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.161.44 as permitted sender) smtp.mailfrom=21cnbao@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712922576; 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=JkmaL5dnbNToitX+dr2yruhYVAPZI2DFDH1TSVGRV7w=; b=UplS5XYicJUsEhMMytaC/QSmrY8jPQ8eDo8Jg6ZFj/zRMO6017iB7wQRkeodpVW9vZpbv9 ELNdRGjnFndSdrDmowGleTwa7mvqlB9w0IRyzcSy/3RBOJmNGi7kj7zJGR8Ra3FiYgXg0U uSqC6rWVpqVDTqpQOtkE9zViw8dmyGQ= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=kenCTHg4; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf06.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.161.44 as permitted sender) smtp.mailfrom=21cnbao@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712922576; a=rsa-sha256; cv=none; b=04Fe02XsfHN8RpU9ZDDWoahT6VaVvYuFqjN512MAaEypo6AKUbW3SurrOam6Shf20WkqtE +KxGFzGM4AXEqRQvguRVsdFH4IHJ0CPRbdv+LXxzgKNJCNf+YiL7eP37PIYO5dLnI4aivK 5JQvrQVbNsu9pOHxns0jf0TGHOW1l/w= Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-5aa12c21ff4so542266eaf.3 for ; Fri, 12 Apr 2024 04:49:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712922575; x=1713527375; 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=JkmaL5dnbNToitX+dr2yruhYVAPZI2DFDH1TSVGRV7w=; b=kenCTHg4JNox/5yKNWJoSDq/G/ni6445oi1YsJw6RnlD8+BY2Z3UsHyModJ/T7xOQR jjN9VkwMT+hhxXe8b3XugbSNskq8t+Tcd6fAzDqtcxVtTh7fO/hg9IPGqsw7TIsQ1l7l kIkljOt0QzpfP7wLmlHV4raAxh04w5R6U91SWRRoOs5V6rHZGefBctkKKyv6Sd3QH/Bv fsj00qSQ1YTkzV4pUpuNbMoMO5nU1pbE07ckSRBZ02Gt/yLOUhBu3A58T2FXA1FaIz9X oEI5vAkqs79cT7WnTb7DAPGZOHfFmWEjpW7uNfWo6eBjNRTudnT37PgL1wzMRj2wABp1 ZxEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712922575; x=1713527375; 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=JkmaL5dnbNToitX+dr2yruhYVAPZI2DFDH1TSVGRV7w=; b=NMlHh3Xp+4Gc1MOoxUTFDm40ZOFKCscofHt2hTIZfemFxOnDfPgQWRBc71/cgONrDU OdJpeDe9C6Av1gcTd9nP9xbH1ff5XgtBT2eoA2MtLozBJEnaih1TPPkv54lzew1qlroH 7KN+4dUUMaXXVLwlc1XVRHX6dF6U9MZ8rdHsMuaNUIWL95wKy+acUDpiTKWJIh0IAlqk 3p1iH4u9yFKrqRtfmBgtYFDdnWZyknTXbPtqAWnbTHEt/jxVlL0ME+0rC+P3doCFuwvt Eleok56NfBGD+GL8eQ9Bc1/vWOqSjUPA30TYjbilWC6VjIOPX5wT85hLwTHuVf9lJ/GF JiQw== X-Forwarded-Encrypted: i=1; AJvYcCWxCCZZhTimkBxHhc8GTBCXqTs7y0Y8/7AKeCgfnaZ1HZ+6t8qbKd+SL8JFTQtia9O2Dk2ZzfAHrPDcd5diK+D3PC8= X-Gm-Message-State: AOJu0YwxeI0hR2g5HuZiegf/sZCoukOqQCiU/0wJq66gVIOyMcL7R81K YrM5eiLvUQy19YorWQx7KuDhLoaDPhZBbcm0C56M+p/+Tq/SKMBG X-Google-Smtp-Source: AGHT+IELpsWoBmGsNvBBR/x1yJEqJQU0ioXXjh7/o28t3fv1i7+x6sXnF0k1SDCwzsvXK5vX3cvAmg== X-Received: by 2002:a05:6871:b27:b0:22e:a204:9bb5 with SMTP id fq39-20020a0568710b2700b0022ea2049bb5mr2485122oab.53.1712922575076; Fri, 12 Apr 2024 04:49:35 -0700 (PDT) Received: from localhost.localdomain ([2407:7000:8942:5500:aaa1:59ff:fe57:eb97]) by smtp.gmail.com with ESMTPSA id q1-20020a634301000000b005e43cce33f8sm2541048pga.88.2024.04.12.04.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 04:49:34 -0700 (PDT) From: Barry Song <21cnbao@gmail.com> To: akpm@linux-foundation.org, linux-mm@kvack.org Cc: cerasuolodomenico@gmail.com, chrisl@kernel.org, david@redhat.com, kasong@tencent.com, linux-kernel@vger.kernel.org, peterx@redhat.com, ryan.roberts@arm.com, surenb@google.com, v-songbaohua@oppo.com, willy@infradead.org, yosryahmed@google.com, yuzhao@google.com, corbet@lwn.net Subject: [PATCH v6 4/4] mm: correct the docs for thp_fault_alloc and thp_fault_fallback Date: Fri, 12 Apr 2024 23:48:58 +1200 Message-Id: <20240412114858.407208-5-21cnbao@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240412114858.407208-1-21cnbao@gmail.com> References: <20240412114858.407208-1-21cnbao@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 08BB318001D X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: ukrj5154abiuzg1dfi7k8gytn9starsq X-HE-Tag: 1712922575-683511 X-HE-Meta: U2FsdGVkX194zlay5QJCBpr057Y93GQvgbc1B38ijZBypN0v1Plx6yHIq2z0z/sY2KfYQeO2rdTiWDtimimgxsygJv2WS93CrcEyJGsCK/fmaIdnRC2vDQE/0IVSY/g9DVKWeibNa14ZfBZjAMgsj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V0udnIe3F3g3T0FTJSZwDoeJRLdIWMJw9hMJI8CsUcFrZhaboUJc76weoHEWMOE06sIcWgS04hWXauJOpUZr6ydK3WlCn4amPaKEI5BJMpD3Jf0MWmMNwlkTt7KhGcGsCf/TQAsTvq7hMK2LtDKns0ojCU3+uGdgLLEN0LkrlfZymAElsv14tZf6PqUgE22ifakRH+VYv+ifB4U4fJAd+xbbzzxrIaq+4x22uvcl7tt1xRN4jUHhO90Is5HaB11N3fKKF4R9CIP6EWwZFLzBlH90nQ7MGfvnrsxwLZQbOBEg+frDN3En1m1PJU3BDMATDpFSN0GGa+tn9ioI10ys9cZGXsi+mF+J57/O17DQxHADjfRhAH7M3WlssovgTcleWa+z3NCX98VeCn35N6fbm1J5zKyXdH2r/O16W0YGia3JRwR8uqEUxAq7/SdDLmHF9jhZLBDp/XUobl4kInvfm183EOKRZSsNB7oRbRg77PsuKRcHrPJYpZ0rjsS7EF5/uVgIhJtZpIreiYM7bAxoBENzVX4feAvy8/zqNyl1FX88NjHyt75SOttUVtNQVCY8rUAf9dusIWKO6kqzAF0cPN0XeMHVDV0x1ClAxTAnNc9NmySlAAB/+ewWYxkyzXTiW2za5m74XCKtEowr5jiCwnG8Zkgk7KUCGVLWUnomiWu3Lm6u3gq2E4= 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: From: Barry Song The documentation does not align with the code. In __do_huge_pmd_anonymous_page(), THP_FAULT_FALLBACK is incremented when mem_cgroup_charge() fails, despite the allocation succeeding, whereas THP_FAULT_ALLOC is only incremented after a successful charge. Signed-off-by: Barry Song Reviewed-by: Ryan Roberts Cc: Chris Li Cc: David Hildenbrand Cc: Domenico Cerasuolo Cc: Kairui Song Cc: Matthew Wilcox (Oracle) Cc: Peter Xu Cc: Ryan Roberts Cc: Suren Baghdasaryan Cc: Yosry Ahmed Cc: Yu Zhao Cc: Jonathan Corbet Reviewed-by: David Hildenbrand --- Documentation/admin-guide/mm/transhuge.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index e0fe17affeb3..f82300b9193f 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -369,7 +369,7 @@ monitor how successfully the system is providing huge pages for use. thp_fault_alloc is incremented every time a huge page is successfully - allocated to handle a page fault. + allocated and charged to handle a page fault. thp_collapse_alloc is incremented by khugepaged when it has found @@ -377,7 +377,7 @@ thp_collapse_alloc successfully allocated a new huge page to store the data. thp_fault_fallback - is incremented if a page fault fails to allocate + is incremented if a page fault fails to allocate or charge a huge page and instead falls back to using small pages. thp_fault_fallback_charge