From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 174C0BA41 for ; Fri, 9 Aug 2024 09:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723194356; cv=none; b=qvr7a51ScoAEApmqxFyDm4qP04xtsDCibtNGkpSm8Jym0OzuDtivqlBrNoLnVGCRXtcQDG1Hio7pwrYSnWBGqsNA+SMTaNEMhEb4hO9MPHk5LVykp/02O32DF3CCTS/6tlXP/d37VdwYhWDlLcsvJ0Eo2+U8Ok35uoAXiBVz1AU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723194356; c=relaxed/simple; bh=XSmLzU5UdFAB1VFUrX7MA56hBPiTogs2+/NMh6rIIvk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=h1mdoVaxwgGjO/Eea6rxEV8ufraZhBzvPo26D/uCpwTWrmLshFsr0wCWlNFXuENwES+Tq/4/zWb/9SinXtbiHMvY4248PebGWtFIPDrxnahMRWkhpExU1cArlJ27N5zgVASDYQl/bfteCEvJ20A7KZirtyhhFQYeYlkv1i/LeyU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 24DD2FEC; Fri, 9 Aug 2024 02:06:20 -0700 (PDT) Received: from [10.57.95.64] (unknown [10.57.95.64]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A18EF3F6A8; Fri, 9 Aug 2024 02:05:52 -0700 (PDT) Message-ID: <9f8ba5c8-5bc3-4af2-96d2-2f52ee923ef5@arm.com> Date: Fri, 9 Aug 2024 10:05:51 +0100 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 RFC 1/2] mm: collect the number of anon large folios Content-Language: en-GB To: David Hildenbrand , Barry Song <21cnbao@gmail.com>, akpm@linux-foundation.org, linux-mm@kvack.org Cc: chrisl@kernel.org, kaleshsingh@google.com, kasong@tencent.com, linux-kernel@vger.kernel.org, ioworker0@gmail.com, baolin.wang@linux.alibaba.com, ziy@nvidia.com, hanchuanhua@oppo.com, Barry Song References: <20240808010457.228753-1-21cnbao@gmail.com> <20240808010457.228753-2-21cnbao@gmail.com> <1222cd76-e732-4238-9413-61843249c1e8@arm.com> <4465afdc-23e9-4844-a0a0-519f49b1229c@redhat.com> <616401ea-289d-4ae2-acde-6704b0fa9c46@redhat.com> From: Ryan Roberts In-Reply-To: <616401ea-289d-4ae2-acde-6704b0fa9c46@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 09/08/2024 09:58, David Hildenbrand wrote: > On 09.08.24 10:42, David Hildenbrand wrote: >>>> Not sure I fully understand why David prefers to do the unaccounting at >>>> free-time though? It feels unbalanced to me to increment when first mapped but >>>> decrement when freed. Surely its safer to either use alloc/free or use first >>>> map/last map? >>>> >>>> If using alloc/free isn't there a THP constructor/destructor that prepares the >>>> deferred list? (My memory may be failing me). Could we use that? >>> >>> Additionally, if we wanted to extend (eventually) to track the number of shmem >>> and file mthps in additional counters, could we also account using similar folio >>> free-time hooks? If not, it might be an argument to account in rmap_unmap to be >>> consistent for all? >> >> Again, see NR_FILE_THPS handling. No rmap over-complication please. > > ... not to mention that it is non-sensical to only count pageache folios that > are mapped to user space ;) Yes, good point. I'll get back in my box. :)