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 6CC77C25B78 for ; Thu, 23 May 2024 01:04:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A9C626B007B; Wed, 22 May 2024 21:04:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A4C626B0082; Wed, 22 May 2024 21:04:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 914F76B0083; Wed, 22 May 2024 21:04:10 -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 77BE86B007B for ; Wed, 22 May 2024 21:04:10 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 03559160219 for ; Thu, 23 May 2024 01:04:09 +0000 (UTC) X-FDA: 82147864260.02.B049545 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) by imf11.hostedemail.com (Postfix) with ESMTP id 98B8140010 for ; Thu, 23 May 2024 01:04:06 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kxENfM+3; spf=pass (imf11.hostedemail.com: domain of ying.huang@intel.com designates 192.198.163.17 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716426248; 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=6KZp78z1V2Z0FiUdtnofGAKIWFCqy+sBgQH+Ou4xAcA=; b=pONyjRVYk7zNdKpffG/Oz/jkSHYQdZe69OhqEgDML0FgFKi0fWelfYbpdxfIRzb8zpvoYx 3APKJONb15K6+VVhQJYDeK0g2e1KydiBvOgKPSipSnjBaWUvEZePSHtTyRApSKkvgMykEr CV8N56pUh2agAdtnFWy1TAY2cQeoJ64= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=kxENfM+3; spf=pass (imf11.hostedemail.com: domain of ying.huang@intel.com designates 192.198.163.17 as permitted sender) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716426248; a=rsa-sha256; cv=none; b=YDm0s8b0bQLMHb3SuweJE8fIvrZGjiSZYn2t2qJdL5N0J45pfh4ntFC7FctQ7DdiEY5lYN teO8DUVWUTl7dKDb2jRF20W4KAGgIdPIke/Wp03aFJleMi/YzxCpsKkq7p7ry4qBQm+i4l cPOHwyv+EqJPs6uSEfwhzfX/U/2vHSw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716426247; x=1747962247; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=xuVimXmATg4JcE4J/zHQiQR6R8dLYbJIHSZrB0l2/6c=; b=kxENfM+3yKyArq71n9yvBZMCtNQpuiakvKGeVkLyP42JKyi59PculVVl DQZuEgmG7uRIpQSWlqIw8sLaJhzRL67da6t3cTOfiw8m/4KbyQqwJlQ6Q E5QJ/2RZ15i/ou28yr/4SvEMATRYzOkZjdqTSbMDK2CHyRh5wf6lUO2Vx u4HhIzBZh7xZLAZ0yZxD6uw1nmw+vb0UMlqY7bx/nRymImxKNG5xgszMP 3Hvdk5NtaZsw+Lx5qOjMnV/RlNorC0bOHJV3sa9o3wxNMnrPYeDt6mKuQ x/xZl0j//sE7uoZ3h1s+i0pHHGCsKb58WBpt9oCJrzSJ4nn9raXoybb7R A==; X-CSE-ConnectionGUID: LN8VOnGISVe+00whNsoM0g== X-CSE-MsgGUID: KfFqEjLERWKvn0Wrz1MaDg== X-IronPort-AV: E=McAfee;i="6600,9927,11080"; a="12590218" X-IronPort-AV: E=Sophos;i="6.08,181,1712646000"; d="scan'208";a="12590218" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2024 18:04:05 -0700 X-CSE-ConnectionGUID: AsK3JofGRmuXrtneQVWPmw== X-CSE-MsgGUID: UHc51AbVReeemWx1TNt4tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,181,1712646000"; d="scan'208";a="33546735" Received: from unknown (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2024 18:04:02 -0700 From: "Huang, Ying" To: Baolin Wang , Barry Song <21cnbao@gmail.com> Cc: David Hildenbrand , , , , , , Subject: Re: [PATCH] mm: drop the 'anon_' prefix for swap-out mTHP counters In-Reply-To: (Baolin Wang's message of "Wed, 22 May 2024 19:24:45 +0800") References: <0e2a6f232e7579a2e4407ecf075531980d97f286.1716367360.git.baolin.wang@linux.alibaba.com> <22ac01a3-ddbb-4114-88cd-ad1a31982dad@redhat.com> <51ba1fc1-fd77-4601-8d27-459162fd008c@linux.alibaba.com> Date: Thu, 23 May 2024 09:02:10 +0800 Message-ID: <87a5khbast.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 98B8140010 X-Stat-Signature: fimb6i43n83az4dt7afpqjm9os1xopgq X-Rspam-User: X-HE-Tag: 1716426246-435644 X-HE-Meta: U2FsdGVkX1/qeMl+dh3aih+DEBnDer2+pKwKveNoKQnZOtktvG9lPBu6jRXpgF2p/61u64y3hi9mEpYAdxPJPXIrRJ9Xdqx9uqiWVMIa0gLlw9nowf9tBaj9QuiijdFh5rEw3Gyfn5ocXMpZeQfnxd9tQETc6CPGpK1NYBLRA1xentUvDtSkEU4JU7qHwY9Ke0EEHbDVNQHapbrtqrFxDs/ULj+GZYo+W0gxVE/q957x1EjbtjMNn0dufv5/zTTYN7cK7f1j9MHOw+KIBVL9fMjH1DSPuo9WXbKVddNaWi5vVDY4B20B9ytiQPMbrHioDG8/JPl+PcxdbU+79QFBC+BTexkLw08pVVsv5yIWCu8Af68LeTPHEZtH5K02Eg1h9TiD+lv/4vnKpsPhKbX+hjtDz9NHjOs19XSad4HCVXhvCZi4qRAFhstHA8lJ8HBjfPbfFQBMDC1yigPw/PnJ+2JO8gwJaL3j/QyRBz9XulChWMgVLjubst1OAgiW8Yyy7ttU0CfuywlFX3ttEBr3L4C8X4lhlA0WcX6KHSjSWAWpd7TpYJwp6m+ebXpWIHZFCc59+/bd/Fh3wKc6/Im9XDRA187+9Hh8Yo9uWurNG3ICrDMKfQo8r1vyLxoLtNC7mNs7JG7UBc0UM6ItnOFs1BUswA2JSbJ0fl8i0N0NjZNKpZXgUcIKH6A3JKJCRglFdyf+pYwOaAw/sTdBZ0UhLwnXjU5lcbPcdLlmFg2n/2cagvWCG9IXCzw3lWU9mwiYhtpPXM7WIbvR2KewVhAHClrY1/jeRyiyrwXj3vHE+GEIu8TGojZUtFQtlDcvAhQPZdxmQjAySrYnT8mbfgy2JBT3fduB57V1+wFl/3c6CoA9Yrudv2E4SlKCmFhqSL+vo6bPp2evSss= 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: Baolin Wang writes: > On 2024/5/22 18:40, Barry Song wrote: >> On Wed, May 22, 2024 at 9:38=E2=80=AFPM Baolin Wang >> wrote: >>> >>> >>> >>> On 2024/5/22 16:58, David Hildenbrand wrote: >>>> On 22.05.24 10:51, Baolin Wang wrote: >>>>> The mTHP swap related counters: 'anon_swpout' and >>>>> 'anon_swpout_fallback' are >>>>> confusing with an 'anon_' prefix, since the shmem can swap out >>>>> non-anonymous >>>>> pages. So drop the 'anon_' prefix to keep consistent with the old swap >>>>> counter >>>>> names. >>>>> >>>>> Suggested-by: "Huang, Ying" >>>>> Signed-off-by: Baolin Wang >>>>> --- >>>> >>>> Am I daydreaming or did we add the anon_ for a reason and discussed the >>>> interaction with shmem? At least I remember some discussion around tha= t. >>> >>> Do you mean the shmem mTHP allocation counters in previous >>> discussion[1]? But for 'anon_swpout' and 'anon_swpout_fallback', I can >>> not find previous discussions that provided a reason for adding the >>> =E2=80=98anon_=E2=80=99 prefix. Barry, any comments? Thanks. >> HI Baolin, >> We had tons of emails discussing about namin and I found this email, >> https://lore.kernel.org/all/bca6d142-15fd-4af5-9f71-821f891e8305@redhat.= com/ >> David had this comment, >> "I'm wondering if these should be ANON specific for now. We might want to >> add others (shmem, file) in the future." >> This is likely how the 'anon_' prefix started being added, although >> it >> wasn't specifically >> targeting swapout. > > That's what I missed before. Thanks Barry. > >> I sense your patch slightly alters the behavior of thp_swpout_fallback >> in /proc/vmstat. >> Previously, we didn't classify them as THP_SWPOUT_FALLBACK, even though = we >> always split them. > > Sorry I did not get you here. I just re-name the mTHP swpout_fallback, > how can this patch change the THP_SWPOUT_FALLBACK statistic counted by > count_vm_event()? > >> if (folio_test_anon(folio) && folio_test_swapbacked(fol= io)) { >> ... >> if (!add_to_swap(folio)) { >> int __maybe_unused order =3D >> folio_order(folio); >> if >> (!folio_test_large(folio)) >> goto activate_locked_sp= lit; >> /* Fallback to swap normal page= s */ >> if (split_folio_to_list(folio, >> folio_list)) >> goto activate_locked; >> #ifdef CONFIG_TRANSPARENT_HUGEPAGE >> if (nr_pages >=3D HPAGE_PMD_NR)= { >> count_memcg_folio_event= s(folio, >> THP_SWPOUT_FALL= BACK, 1); >> count_vm_event(THP_SWPOUT_FALLBACK); >> } >> count_mthp_stat(order, >> MTHP_STAT_ANON_SWPOUT_FALLBACK); >> #endif >> if (!add_to_swap(folio)) >> goto activate_locked_sp= lit; >> } >> } >> } else if (folio_test_swapbacked(folio) && >> folio_test_large(folio)) { >> /* Split shmem folio */ >> if (split_folio_to_list(folio, folio_list)) >> goto keep_locked; >> } >> If the goal is to incorporate pmd-mapped shmem under thp_swpout* in >> /proc/vmstat, >> and if there is consistency between /proc/vmstat and sys regarding >> their definitions, >> then I have no objection to this patch.=20 > > I think this is the goal, moreover shmem will support large folio (not > only THP) in future, so swpout related counters should be defined as > clear as possible. > > However, shmem_swpout and shmem_swpout_* >> appear more intuitive, given that thp_swpout_* in /proc/vmstat has >> never shown any >> increments for shmem until now - we have been always splitting shmem in = vmscan. > > This is somewhat similar to our previous discussion on the naming of > the shmem's mTHP counter[1], as David suggested, we should keep > counter name consistency for now and add more in the future as needed. > > [1] > https://lore.kernel.org/all/ce6be451-7c5a-402f-8340-be40699829c2@redhat.c= om/ Yes. I don't find that it's necessary to distinguish anonymous and shmem mTHP swap-out now. If we need it in the future, we can add that at that time. >> By the way, if this patch is accepted, it must be included in >> version >> 6.10 to maintain >> ABI compatibility. Additionally, documentation must be updated according= ly. > > Sure. I missed update the documentation, and will do in next version. -- Best Regards, Huang, Ying