linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Usama Arif <usamaarif642@gmail.com>
To: Barry Song <21cnbao@gmail.com>, David Hildenbrand <david@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Barry Song <v-songbaohua@oppo.com>,
	Chengming Zhou <chengming.zhou@linux.dev>,
	Yosry Ahmed <yosryahmed@google.com>,
	Nhat Pham <nphamcs@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Hugh Dickins <hughd@google.com>,
	Matthew Wilcox <willy@infradead.org>,
	Shakeel Butt <shakeel.butt@linux.dev>,
	Andi Kleen <ak@linux.intel.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chris Li <chrisl@kernel.org>,
	"Huang, Ying" <ying.huang@intel.com>,
	Kairui Song <kasong@tencent.com>,
	Ryan Roberts <ryan.roberts@arm.com>
Subject: Re: [PATCH v2] mm: count zeromap read and set for swapout and swapin
Date: Tue, 5 Nov 2024 10:44:54 +0000	[thread overview]
Message-ID: <11bd51b2-fa2d-4d99-912a-563521aaa6da@gmail.com> (raw)
In-Reply-To: <CAGsJ_4yzq35ng77LjOi0jj0A6-9o+s5jKgP=S2Cx9fSsJtyzeA@mail.gmail.com>



On 05/11/2024 09:15, Barry Song wrote:
> On Tue, Nov 5, 2024 at 9:23 PM David Hildenbrand <david@redhat.com> wrote:
>>
>> On 05.11.24 04:40, Andrew Morton wrote:
>>> On Mon, 4 Nov 2024 13:32:55 +0100 David Hildenbrand <david@redhat.com> wrote:
>>>
>>>>> As mentioned above, this isn't about fixing a bug; it's simply to ensure
>>>>> that swap-related metrics don't disappear.
>>>>
>>>> Documentation/process/submitting-patches.rst:
>>>>
>>>> "A Fixes: tag indicates that the patch fixes an issue in a previous
>>>> commit. It is used to make it easy to determine where a bug originated,
>>>> which can help review a bug fix."
>>>>
>>>> If there is no BUG, I'm afraid you are abusing that tag.
>>>
>>> I think the abuse is reasonable.  We have no Should-be-included-with:.
>>
>> A "Belongs-to:" might make sense, for this kind of stuff that is still
>> only in an RFC. Or we update the doc to explicitly spell out this
>> special case of using "Fixes" to sort out something into the RC.
>>
>> Because if this would be already in a released kernel, it would get a
>> bit trickier: stable rules explicitly spell out "fix a real bug".
>>
>>>
>>> 0ca0c24e3211 is only in 6.12-rcX so this is the time to make
>>> userspace-visible tweaks, so the 6.12 interfaces are the same as the
>>> 6.13+ interfaces (which is what I think is happening here?)
>>  > > And including the Fixes in this patch might be useful to someone who is
>>> backporting 0ca0c24e3211 into some earlier kernel for their own
>>> purposes.
>>
>> Just to be clear: adding new counters would hardly be fixing existing
>> tools that perform calculations based on existing counters. So we are
>> already changing the "userspace-visible" portion in some way, and I have
>> no idea what in vmstat we consider "stable".
>>
>> But I still don't think it's all that big of a deal except in some
>> handcrafted scenarios hardly anybody cares about; the cover letter is
>> also pretty clear on that.
> 
> I may have been mistaken in the cover letter. According to the zswap data Usama
> provided for servers, zero-filled pages accounted for about 1%.

10% not 1% (https://lore.kernel.org/all/20240612124750.2220726-1-usamaarif642@gmail.com/).

> So
> really doesn't
> matter too much, but I just checked with Hailong from our team—he has data
> on same-page-filled usage in Android apps, which on average show 3-4%
> same-page-filled, with over 85% being zero-filled. Some apps even reach
> 6-7% zero-filled pages. We previously used these counters to profile
> optimizations, but with zeromap now serving as the frontend for swap files,
> those counters will disappear entirely from both zRAM and pswpin/pswpout
> metrics, as folios are filtered earlier.
> 
This is what I meant in https://lore.kernel.org/all/79deed1a-9b0e-42e0-be2f-f0c3ef5fee11@gmail.com/
when I said it affects zram as well!

I am happy with the current version of the patch, just need the change
in Documentation/admin-guide/cgroup-v2.rst.

Thanks,
Usama

> Hailong essentially has a table that looks like the below which could be
> collected from the existing counters:
> 
> com.xxx.app     5% same-page-filled.    88% zero
> com.yyy.app     6% same-page-filled.     85% zero
> com.zzz.map   6.7 same-page-filled.       88% zero
> ....
> 
> Anyone on 6.12 will be unable to track zero-filled pages unless they
> backport this patch from a newer kernel version if it doesn’t make it
> into 6.12.
> 
> Whether it's marked as 'Belongs-to:' or 'Fixes:', I'd prefer we aim to
> land it in
> 6.12 :-)
> 
>>
>> So I'll shut up now and let people figure out the naming first, and if a
>> new counter is required at all :)
>>
>> --
>> Cheers,
>>
>> David / dhildenb
>>
> 
> Thanks
> Barry



  reply	other threads:[~2024-11-05 10:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-02 10:12 Barry Song
2024-11-02 12:32 ` Usama Arif
2024-11-02 12:59   ` Barry Song
2024-11-02 14:43     ` Usama Arif
2024-11-04 16:24       ` Joshua Hahn
2024-11-04 12:32     ` David Hildenbrand
2024-11-05  3:40       ` Andrew Morton
2024-11-05  8:23         ` David Hildenbrand
2024-11-05  8:24           ` David Hildenbrand
2024-11-05  9:15           ` Barry Song
2024-11-05 10:44             ` Usama Arif [this message]
2024-11-05 10:57               ` Barry Song
2024-11-05 11:09             ` David Hildenbrand
2024-11-04 12:42 ` David Hildenbrand
2024-11-04 16:34   ` Johannes Weiner
2024-11-04 17:10     ` David Hildenbrand
2024-11-04 18:48       ` Usama Arif
2024-11-04 20:56         ` David Hildenbrand
2024-11-04 21:24           ` Usama Arif
2024-11-05  1:28             ` Barry Song
2024-11-05 19:35 ` Nhat Pham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11bd51b2-fa2d-4d99-912a-563521aaa6da@gmail.com \
    --to=usamaarif642@gmail.com \
    --cc=21cnbao@gmail.com \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=chengming.zhou@linux.dev \
    --cc=chrisl@kernel.org \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nphamcs@gmail.com \
    --cc=ryan.roberts@arm.com \
    --cc=shakeel.butt@linux.dev \
    --cc=v-songbaohua@oppo.com \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.com \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox