From mboxrd@z Thu Jan 1 00:00:00 1970 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 D163BC3271E for ; Tue, 9 Jul 2024 01:07:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61FD76B0099; Mon, 8 Jul 2024 21:07:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5A90E6B009B; Mon, 8 Jul 2024 21:07:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 470CC6B009C; Mon, 8 Jul 2024 21:07:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 279456B0099 for ; Mon, 8 Jul 2024 21:07:49 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D10D6161588 for ; Tue, 9 Jul 2024 01:07:48 +0000 (UTC) X-FDA: 82318427016.30.54E3767 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) by imf01.hostedemail.com (Postfix) with ESMTP id 5B55D40018 for ; Tue, 9 Jul 2024 01:07:42 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=QsVWUxHq; spf=pass (imf01.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.98 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1720487236; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mECnJeehZNBoxiLQRn/E4jwV446jfFeTcaKLoHUc6Zg=; b=F54olSmgho71pLFOPrilOEk+4yPykQFp7L3ygGC3t3aD7DB+dvBtmUABt9ZvF0dyIae8Ms zUgPqjB0mwsBYw+GxArMgGGBjYyKQMBa5tjT6qp1COa4UXKvD29GVJ94ey3MJiRClLTanD O/sXZ9dECcrTeQsm8NhYP83WfYv6tWA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1720487236; a=rsa-sha256; cv=none; b=ULuAGEQd3e5m7laYjLKCgrwwNlghrD2LV9kPwLS7eYukQiWAQI4C3ycyvQbdlp/6BGF9bU 914L0OSFvPun66ugEAvVcieTdgl45vyk28H1vDDyGqdvU5Zuj55kpWcCbRy4Kx2h1ANDEb M2XrVnhWnxJwkgF7lKcOZud2fkFPEdQ= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=QsVWUxHq; spf=pass (imf01.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.98 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1720487253; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=mECnJeehZNBoxiLQRn/E4jwV446jfFeTcaKLoHUc6Zg=; b=QsVWUxHqzPrsSRZFtCmnsSIGID+B9p1t/K8/ngloj4fAbvzupibE/UJxPfikC0XGMrxNZuXeMk4WOPHeeM63DTxl99p42rIj3HDuTeAaF1i5cen7XesAo3WzffJlBnF0qKz+xWbj//qcu3u1WH81uqHLnIdEPshDCMJhj6Yk8Qc= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R581e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045220184;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0WA9bRN5_1720487250; Received: from 30.97.56.68(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WA9bRN5_1720487250) by smtp.aliyun-inc.com; Tue, 09 Jul 2024 09:07:31 +0800 Message-ID: <2672552a-b252-42ba-964b-db25413a418c@linux.alibaba.com> Date: Tue, 9 Jul 2024 09:07:30 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1] mm: shmem: Rename mTHP shmem counters To: Ryan Roberts , Barry Song Cc: Andrew Morton , Hugh Dickins , Jonathan Corbet , David Hildenbrand , Lance Yang , Matthew Wilcox , Zi Yan , Daniel Gomez , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20240708112445.2690631-1-ryan.roberts@arm.com> <744749c3-4506-40d9-ac48-0dbc59689f92@arm.com> From: Baolin Wang In-Reply-To: <744749c3-4506-40d9-ac48-0dbc59689f92@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 5B55D40018 X-Stat-Signature: cpegxp6jxj4guqmpjsoa9efszqw6h17g X-HE-Tag: 1720487262-845635 X-HE-Meta: U2FsdGVkX19gG9fqf+QULZMo2XD7NEPtxui+zA/Gomim0GB+0AGck55NpbfGANECcJemrZ8DJZUjA1qV6FBIeNANwBm1ya+3U8f6XjCygyMDPy+8/GGC8o85XUxEfQq3F4QV8AOuCQgzSkoitgiM9bCqcDzkHco/CWItvpUiEE2yK9M/AZD3L87J9VZAExaSAF0uXk0uGCcRNNYrZdyER9KliBPSMEEljcoaqdMhMVgiUKDgdroIEvVc8nbRYeScV25mj3GmaLZZBSUAGHJX6D+/rlBQdbKtqRPyYM7wsdQQ8bPbgAEK8AU0PBtx8oLCWlSt0xtiUv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gkqqTEKODbXG8g9FnoEOjo7bGlsEAJB8kFcxspvtoMZrt5Yi7qFZ0uvJrg== 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: On 2024/7/8 20:29, Ryan Roberts wrote: > On 08/07/2024 12:36, Barry Song wrote: >> On Mon, Jul 8, 2024 at 11:24 PM 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. >> >> Personally, I think this approach is much clearer. However, I recall >> we discussed this >> before [1], and it seems that inconsistency is a concern? > > Embarrassingly, I don't recall that converstation at all :-| but at least what I > said then is consistent with what I've done in this patch. > > I think David's conclusion from that thread was to call them FILE_, and add both > shmem and pagecache counts to those counters, meaning we can keep the same name > as legacy THP counters. But those legacy THP counters only count shmem, and I > don't think we would get away with adding pagecache counts to those at this > point? (argument: they have been around for long time and there is a risk that > user space relies on them and if they were to dramatically increase due to > pagecache addition now that could break things). In that case, there is still > inconsistency, but its worse; the names are consistent but the semantics are > inconsistent. > > So my vote is to change to SHMEM_ as per this patch :) > >> >> [1] https://lore.kernel.org/linux-mm/05d0096e4ec3e572d1d52d33a31a661321ac1551.1713755580.git.baolin.wang@linux.alibaba.com/ My original preference was also for SHMEM-specific counters :) So feel free to add: Reviewed-by: Baolin Wang