lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <82B24EA6-7207-4C36-8CFD-7BA372CE9482@nvidia.com>
Date: Wed, 10 Jul 2024 09:34:22 -0400
From: Zi Yan <ziy@...dia.com>
To: Ryan Roberts <ryan.roberts@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
 Hugh Dickins <hughd@...gle.com>, Jonathan Corbet <corbet@....net>,
 Barry Song <baohua@...nel.org>, David Hildenbrand <david@...hat.com>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>,
 Lance Yang <ioworker0@...il.com>, Matthew Wilcox <willy@...radead.org>,
 Daniel Gomez <da.gomez@...sung.com>, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org
Subject: Re: [PATCH v2] mm: shmem: Rename mTHP shmem counters

On 10 Jul 2024, at 5:55, Ryan Roberts wrote:

> The legacy PMD-sized THP counters at /proc/vmstat include
> thp_file_alloc, thp_file_fallback and thp_file_fallback_charge, which
> rather confusingly refer to shmem THP and do not include any other types
> of file pages. This is inconsistent since in most other places in the
> kernel, THP counters are explicitly separated for anon, shmem and file
> flavours. However, we are stuck with it since it constitutes a user ABI.
>
> Recently, commit 66f44583f9b6 ("mm: shmem: add mTHP counters for
> anonymous shmem") added equivalent mTHP stats for shmem, keeping the
> same "file_" prefix in the names. But in future, we may want to add
> extra stats to cover actual file pages, at which point, it would all
> become very confusing.
>
> So let's take the opportunity to rename these new counters "shmem_"
> before the change makes it upstream and the ABI becomes immutable. While
> we are at it, let's improve the documentation for the legacy counters to
> make it clear that they count shmem pages only.
>
> Signed-off-by: Ryan Roberts <ryan.roberts@....com>
> Reviewed-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
> Reviewed-by: Lance Yang <ioworker0@...il.com>
> ---
>
> Hi All,
>
> Applies on top of yesterday's mm-unstable (2073cda629a4) and tested with mm
> selftests; no regressions observed.
>
> The backstory here is that I'd like to introduce some counters for regular file
> folio allocations to observe how often large folio allocation succeeds, but
> these shmem counters are named "file" which is going to make things confusing.
> So hoping to solve that before commit 66f44583f9b6 ("mm: shmem: add mTHP
> counters for anonymous shmem") goes upstream (it is currently in mm-stable).
>
> Changes since v1 [1]
> ====================
>   - Updated documentation for existing legacy "file_" counters to make it clear
>     they only count shmem pages.
>
> [1] https://lore.kernel.org/linux-mm/20240708112445.2690631-1-ryan.roberts@arm.com/
>
> Thanks,
> Ryan
>
>  Documentation/admin-guide/mm/transhuge.rst | 29 ++++++++++++----------
>  include/linux/huge_mm.h                    |  6 ++---
>  mm/huge_memory.c                           | 12 ++++-----
>  mm/shmem.c                                 |  8 +++---
>  4 files changed, 29 insertions(+), 26 deletions(-)
>
LGTM. Reviewed-by: Zi Yan <ziy@...dia.com>

--
Best Regards,
Yan, Zi

Download attachment "signature.asc" of type "application/pgp-signature" (855 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ