From patchwork Fri Apr 12 07:37:40 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: 13627056 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 0C413C4345F for ; Fri, 12 Apr 2024 07:38:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8E2556B0095; Fri, 12 Apr 2024 03:38:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 86BD46B0096; Fri, 12 Apr 2024 03:38:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E53F6B0098; Fri, 12 Apr 2024 03:38:24 -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 4C0E86B0095 for ; Fri, 12 Apr 2024 03:38:24 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1A620160DB4 for ; Fri, 12 Apr 2024 07:38:24 +0000 (UTC) X-FDA: 82000076928.08.C1C5B28 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf11.hostedemail.com (Postfix) with ESMTP id 3B7FA40004 for ; Fri, 12 Apr 2024 07:38:22 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="bYfWyum/"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.214.177 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=1712907502; 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=vLivAlSFWVO5qmFvXnJVwwxKOFwucVM2YU4CcxrDCQY=; b=rTIylY0R6e90Tgg3lDtfQEFHSZAeAwNkrD/taWHS5D07H5DzShr+GiJ+zwXUgWiGOOIP+J W8dcf1ca+2qqmNt6kfzf7LmtAxLnAWjB31leSP8jRzVKo5pzkHQsxRblts+v99LqUaRGpb 5k0R8PpJ79bWObQ9M487fpROgg6fChk= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="bYfWyum/"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf11.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=21cnbao@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712907502; a=rsa-sha256; cv=none; b=xwB5xn9SJnXx5vW8h3g77Nnc3LhVuJ92FpKjc8HPZpkdovk0vdpYLuzqINZ6SlcH4gS2Yi AfQ2eeEC4UeDxH40tJI2HQMnJmxf5afWS9jhCTQg8YDqD+rRCbBg/SrrqCE+17FFyRvctN 9CHSheO1y0f1ZM+vph2sc94ISOACXg0= Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1e3f17c64daso5151195ad.3 for ; Fri, 12 Apr 2024 00:38:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712907501; x=1713512301; 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=vLivAlSFWVO5qmFvXnJVwwxKOFwucVM2YU4CcxrDCQY=; b=bYfWyum/VLCMIqrmuZ17Wg8NBQM3KabiZSNfFonqE5m80HQBfqkcIOq0DcBLtbe1bs I11ibJ0SH+dC40DLmRK97pbTqbmAVz5HusMh+Udl0NpmJS0eC8F96fTgK1Il107i9/IM XqC4Bv+dOTeHL0/hWhnVpJhiiiv11JoGFKsMYaG5k89TzI5anipjRSychFtqrdDR+Hig vlWrjctcfKEmRGtpDJjiq6fTIsf+XYp3csG6TVd7JNiRRpF1j5PNXp7L2HHB0jCSueVP gw0o5GMoUG/Sn8NdOrfsQw6wh6BzMFfNQuHtjxDMK8qjUaR4hCR9wK1mCXtLrdQ7HulB MksA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712907501; x=1713512301; 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=vLivAlSFWVO5qmFvXnJVwwxKOFwucVM2YU4CcxrDCQY=; b=UbdpBp0RWYceSrUZch1w2Bk6VYLdIzUoTFwpB4iC7jPjeUhIAx7GLw1A8Kz+OqSZD9 zM8x069KBIl3s3o/YfVeAL+jbNtuX4z/fzRlE9uJf+7wMjIQ/YQxeIufpQH6Jb9knxkf VCV0vnnQV+Si0lacIvsmaXP1WCrXgFkVhc+YnQpa8HjYfaWddt921w58oNBbXHM2qb0U RSinEhoGa0r1nFkEe6kiJXw8yuenTa24UujW/z6rQ6n8O/yj7NKdu8OUy1BFexWXp2Sp xk6jIjv/HLEG5LQD9vxI7i454nk0zlDiFL49pWODS4tDS0rkDXxpxL5eoCBDn5VVDO07 ljDw== X-Forwarded-Encrypted: i=1; AJvYcCVmB6IMHbBkVtm3/GNWp1smPaiwgUNxKPHO411UdFu0YVYZEc5UG+CjaXsK50RDbTSJY3QhAJfpwXWnEWWCEIPJa8w= X-Gm-Message-State: AOJu0YwhIbBE5DDVz3mBIegyTxpYEGwJhEbSjNPAy6vdagfP7xZhznyN +4vaRAUbrcJ0m7HM3Db43/TkXW5XFqCiUcc0ln7fwUGm2qrvOvuA X-Google-Smtp-Source: AGHT+IHgBpc7UAQvJAcCBWbdfiIookBgasRuDbzAV/jyU0fOVDPDt6/r0/rQy9bL8YhPtuipQpw50g== X-Received: by 2002:a17:902:ec8e:b0:1e2:9ac2:4a03 with SMTP id x14-20020a170902ec8e00b001e29ac24a03mr1874586plg.28.1712907501110; Fri, 12 Apr 2024 00:38:21 -0700 (PDT) Received: from localhost.localdomain ([2407:7000:8942:5500:aaa1:59ff:fe57:eb97]) by smtp.gmail.com with ESMTPSA id n5-20020a170903110500b001e478f359bdsm2344011plh.127.2024.04.12.00.38.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 00:38:20 -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 v5 4/4] mm: correct the docs for thp_fault_alloc and thp_fault_fallback Date: Fri, 12 Apr 2024 19:37:40 +1200 Message-Id: <20240412073740.294272-5-21cnbao@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240412073740.294272-1-21cnbao@gmail.com> References: <20240412073740.294272-1-21cnbao@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 3B7FA40004 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 7z4p6a7fp6c8pgf1y9pcg748uj8wjgp6 X-HE-Tag: 1712907502-767892 X-HE-Meta: U2FsdGVkX1/JCU9vpjbNE7f9Ci2a+BWL1iR/MJ1lGIuAu2/T1U6vxSi8VHcy3lDSjY5sB9TtkGTNWTd+9h2N4ifQgy3o6rPjlqhdxqmMbZiUdgzWo85UHlOQKn4AbBVbx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o1ACt820N1Zdywha7yBZIDJV/YFS+NVss8z422hkgGYJ5Mh/H8QC0IbPVze4ItapiCXjSxhuNsc2QDz6u6SENbXnEOBduBKuV3el0XrnvZgxMUI4WZcLLp/Al2DmFxjUlCstlaQcoqX00VMAakQEYuJaBUTGPy7s4SP7DLeYzWAtEsNyGs5UwKcks/VdXUvZPj5v4pIDtRjAt6pKQHoE8uLWyJgnFISQDobr0vkhxYBZRDXTpGErsR9XQSsAgHBr3lcWyBWBzYxQJcsGzznMp02C1VbiTGLvhg1e+c9XOSTkyX0vBBYqwUs9WkOFD2MLRSbZVK8xhi/OHObC4lY+ffVv2vrE2QSTh5KrXmjbqRKo1YEDQuOodFPAfXQzTr40BceijhVMKM5cL693MuPq3MGhH00sBPjXNTsDv7zOuuR6Ifgv1jFBX2J99znLV2p/su1UlSjwtzUICuBaj+FpmPNs4u4AnzE5alobhpguzs9qCxvzc066gBKWnadN3iOQ0yY3sL70QnOoGRh+tDvWyoMGF0CG9hDoFii90dc6yqqDEfE+tKkHFMZ6n7fyZLVpiUmvXh4XC0vftuXQbdxwAwemLeGX/qNkaWLDcYCe/tloj1XQg4aCSLB0sQJjvQT/LqgIfPORwMXsiAfGRFbpzcXA8JffOb3Q24n9d8QDl0vb+9D2Xle+ENuNDJBjShcpmorR5NBiEFyO5w8hg== 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 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: Ryan Roberts --- 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 f436ff982f22..98e3a99ea780 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