Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp726195lqp; Wed, 22 May 2024 19:32:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFPnCgpYSi74sHbwdofdL+hioTMZcMDPKnFN6CsOT3byUTauDAy6Yt0h1dTGM+J4xq4BR0i41ktsarA/JJfnUWbstYMoGwUGV8u+BZPQ== X-Google-Smtp-Source: AGHT+IG9GQKupBmnJRmAO24zN+wX7L2t95hljPxvgN862Y3IotXLEz6IVV5PRZMPunPOQU+JjzE2 X-Received: by 2002:a05:6000:e47:b0:34e:aef7:4ff9 with SMTP id ffacd0b85a97d-354d8d9c972mr3253017f8f.61.1716431525585; Wed, 22 May 2024 19:32:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716431525; cv=pass; d=google.com; s=arc-20160816; b=rsk15rYiw1jrKPFQLMusnarpz8/27y3FdYOSnUHsYQL0dG491tTKJYXctdJmAe+uPG 8cxvkqzF+9aoZiWzTo3PLW8B8il6nAKlQNBiYqe7g5XA3B1VCvFFbGF6NTHhjx05xBB2 QEkW/w24zLj2gI41AnW99Ij5dS9s9Guh21ltGyO5idRygMBmFgo3353y4Hxbmnx64rCu 0gjI8eshvwXDVMjBMkFt43t9dbIBAavnS+Qnbr7u8eV5eJCyrkZz2IXv2ZInw+4gkn6F /KhiVnm2zGpn5KxdK1jkX5LW+FnG+D1Tiur/Am5cqgC8y3ZBHQMKvkszBRu8cuCfeMZ6 8eLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=ack/kVE3TxqOGngSexMdxdtp5NY2ZX4sfLT+4hAq/lQ=; fh=6klzUG/xJcaE6klCamMT8y3JJWwRYArIOo2DQPht8NI=; b=ZoUYRdwUKC8+rGKPgM5qbVL0+h08L3Ox90QzCAD4L96Os5PZxNFP0lAuhnPjYOIkFB 7oO1qg8mpY8byYTY4HU7InaYR/VPatTHIFNUW2LvczLvMn1nzrisCd8hntHHhK3OBp2V 3Au/gktC01HkMUs9nARe4Fk434/3yroZLmCH8I7HHkvK+PkjO7jobg9nYKq1JH5dAEMe 0769BrQHR0AHhcEzrlu9D/pvK0eY/TjrpyDpO0x6DHROSDWzQAs/LrEYSVWl9Dd68iB1 jgo5jWLtBpAYP7vzIVDpPtne8qlBbHk9cMgkltzx3Q5Mpe7Lg0dM0rwkuLLaIW0WC22A X4gg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=bC1i7g6u; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-186916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186916-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5cdbbfd77esi911124866b.671.2024.05.22.19.32.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 19:32:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=bC1i7g6u; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-186916-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186916-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 28B4C1F217F2 for ; Thu, 23 May 2024 02:32:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D70A13A248; Thu, 23 May 2024 02:32:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="bC1i7g6u" Received: from out30-97.freemail.mail.aliyun.com (out30-97.freemail.mail.aliyun.com [115.124.30.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A95E3139D19 for ; Thu, 23 May 2024 02:31:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.97 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716431519; cv=none; b=KIsmliGMDtUp2C88Srd8AisVHyioEZuK1hY/Vu5FuZKLl4hegIqPKHQYZDTvEuhkgzk77lIDEXelS3zrrFDANlsISkbcVH91TsxvGJaUJLy4WpbZ7P8g3GbMPwfAybHVRGlIQ6S3blpq0QPT1Qhgf8/x0sQl7EHTm0kHixK23dE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716431519; c=relaxed/simple; bh=HP2XqW4W+jCxshQoOMFnVzTfRYwt8O0PDxXiJCe02mY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GxsC7QAg/+Syt5PBP/xiTK4D0shnpNutOTtyJcoFO03ZvMiu2yuUrvT3TY4i4kIcRV78A2Uup2Ofs4A+NeFebuQaKTpdX5yI2xNj1B9QFI/5vWEAL6jM4P/qdTRXymC+psT6UopbARUH9huk9MIigKMWDyJiTKt/ZRYEY4R2eoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=bC1i7g6u; arc=none smtp.client-ip=115.124.30.97 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1716431515; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=ack/kVE3TxqOGngSexMdxdtp5NY2ZX4sfLT+4hAq/lQ=; b=bC1i7g6uMV5JAGFhhNlrNIud7xG3jIwQ1S25QdNoOExENcQVweT/A0mvcKnPhGY8qSdADqGEb117d1euWZtPoAMY8u/Vs6TMS1BJpzgqKu+gtAMG19/lzU6lkOViJyLsJpJbKQ7gpxx3PL5emJydaxC+JPuQuExOVK1ZY7X5rMI= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033045075189;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0W718O2a_1716431513; Received: from 30.97.56.57(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W718O2a_1716431513) by smtp.aliyun-inc.com; Thu, 23 May 2024 10:31:54 +0800 Message-ID: <2ee94722-456f-4db0-9ed9-3f1c72239a75@linux.alibaba.com> Date: Thu, 23 May 2024 10:31:53 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mm: drop the 'anon_' prefix for swap-out mTHP counters To: Barry Song <21cnbao@gmail.com> Cc: "Huang, Ying" , David Hildenbrand , akpm@linux-foundation.org, willy@infradead.org, ryan.roberts@arm.com, ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <0e2a6f232e7579a2e4407ecf075531980d97f286.1716367360.git.baolin.wang@linux.alibaba.com> <22ac01a3-ddbb-4114-88cd-ad1a31982dad@redhat.com> <51ba1fc1-fd77-4601-8d27-459162fd008c@linux.alibaba.com> <875xv5ba8t.fsf@yhuang6-desk2.ccr.corp.intel.com> <18aa865a-6d4a-4dcf-99ce-bcfbc0c92f19@linux.alibaba.com> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/5/23 10:12, Barry Song wrote: > On Thu, May 23, 2024 at 1:38 PM Baolin Wang > wrote: >> >> >> >> On 2024/5/23 09:14, Huang, Ying wrote: >>> Barry Song <21cnbao@gmail.com> writes: >>> >>>> On Wed, May 22, 2024 at 9:38 PM 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 that. >>>>> >>>>> 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 >>>>> ‘anon_’ 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. >>>> >>>> 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. >>> >>> IIUC, "fallback" means you try to do something, but fail, so try >>> something else as fallback. If so, then we don't need to count >>> splitting shmem large folio as fallback. >> >> Agree. In additon, IIUC we have never counted splitting shmem large >> folio as THP_SWPOUT_FALLBACK before or after this patch. > > Hi Baolin, > > My point is that THP_SWPOUT* has been dedicated to anonymous memory for years > because we have not had the capability to perform THP_SWPOUT for shared memory > before. This is the historical context of thp_swpout* in /proc/vmstat, > even though it is > not ideal. Therefore, placing shmem sysfs entries in > /sys/kernel/mm/transparent_hugepage/hugepages-2048kB/stats > allows us to monitor SWPOUT and SWPOUT FALLBACK for shmem without altering > the tradition of /proc/vmstat. OK, I see your point. IMO this patch will not change the behaviors of thp_swpout* in /proc/vmstat until adding support for large folio swap-out for shmem[1]. Anyway we can talk about this in that thread. [1] https://lore.kernel.org/all/cover.1716285099.git.baolin.wang@linux.alibaba.com/ > But I am not firm on this because I don't see the necessity to > differentiate shmem's > swpout from anon's swpout. They basically seem the same while anon mTHP > faults might be significantly different from file mTHP faults, in which case we > must distinguish them. So please send version 2 with the updated documentation. > I believe it should target v6.10-rc rather than v6.11 to avoid ABI > conflicts if it is > accepted. Sure. Will do. Thanks.