From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: akpm@linux-foundation.org, hughd@google.com, willy@infradead.org,
david@redhat.com, ioworker0@gmail.com, hrisl@kernel.org,
p.raghav@samsung.com, da.gomez@samsung.com,
wangkefeng.wang@huawei.com, 21cnbao@gmail.com,
ryan.roberts@arm.com, shy828301@gmail.com, ziy@nvidia.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/8] mm: fix shmem swapout statistic
Date: Wed, 22 May 2024 15:54:00 +0800 [thread overview]
Message-ID: <a859c435-9190-465d-ac88-82d47f06cccd@linux.alibaba.com> (raw)
In-Reply-To: <87le42b9l6.fsf@yhuang6-desk2.ccr.corp.intel.com>
On 2024/5/22 15:16, Huang, Ying wrote:
> Baolin Wang <baolin.wang@linux.alibaba.com> writes:
>
>> As we know, shmem not only supports the sharing of anonymous pages, but also
>> the RAM-based temporary filesystem. Therefore, shmem swapouts should not be
>> marked as anonymous swapout statistics. Fix it by adding folio_test_anon().
>>
>> Fixes: d0f048ac39f6 ("mm: add per-order mTHP anon_swpout and anon_swpout_fallback counters")
>> Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
>> ---
>> mm/page_io.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/page_io.c b/mm/page_io.c
>> index 46c603dddf04..b181b81f39e3 100644
>> --- a/mm/page_io.c
>> +++ b/mm/page_io.c
>> @@ -217,7 +217,9 @@ static inline void count_swpout_vm_event(struct folio *folio)
>> count_memcg_folio_events(folio, THP_SWPOUT, 1);
>> count_vm_event(THP_SWPOUT);
>> }
>> - count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPOUT);
>> +
>> + if (folio_test_anon(folio))
>> + count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPOUT);
>
> Do we need to distinguish anonymous swapout and non-anonymous swapout?
> IMHO, we don't. Just like we have done for small folio and THP.
Yes, old counters did not add 'anon_' prefix.
> If so, how about fix this in another direction? That is, remove "ANON"
> from mTHP swapout statistics?
This sounds good to me. And I will separate out an individual patch with
your suggestion. Thanks.
next prev parent reply other threads:[~2024-05-22 7:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 11:03 [RFC PATCH 0/8] support large folio swap-out and swap-in for shmem Baolin Wang
2024-05-21 11:03 ` [RFC PATCH 1/8] mm: fix shmem swapout statistic Baolin Wang
2024-05-22 7:16 ` Huang, Ying
2024-05-22 7:54 ` Baolin Wang [this message]
2024-05-21 11:03 ` [RFC PATCH 2/8] mm: vmscan: add validation before spliting shmem large folio Baolin Wang
2024-05-21 11:03 ` [RFC PATCH 3/8] mm: swap: extend swap_shmem_alloc() to support batch SWAP_MAP_SHMEM flag setting Baolin Wang
2024-05-21 11:03 ` [RFC PATCH 4/8] mm: shmem: support large folio allocation for shmem_replace_folio() Baolin Wang
2024-05-21 11:03 ` [RFC PATCH 5/8] mm: shmem: extend shmem_partial_swap_usage() to support large folio swap Baolin Wang
2024-05-21 11:03 ` [RFC PATCH 6/8] mm: add new 'orders' parameter for find_get_entries() and find_lock_entries() Baolin Wang
2024-05-21 11:03 ` [RFC PATCH 7/8] mm: shmem: use swap_free_nr() to free shmem swap entries Baolin Wang
2024-05-21 11:03 ` [RFC PATCH 8/8] mm: shmem: support large folio swap out Baolin Wang
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=a859c435-9190-465d-ac88-82d47f06cccd@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=da.gomez@samsung.com \
--cc=david@redhat.com \
--cc=hrisl@kernel.org \
--cc=hughd@google.com \
--cc=ioworker0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=p.raghav@samsung.com \
--cc=ryan.roberts@arm.com \
--cc=shy828301@gmail.com \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.org \
--cc=ying.huang@intel.com \
--cc=ziy@nvidia.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