From: "Huang, Ying" <ying.huang@intel.com>
To: Baolin Wang <baolin.wang@linux.alibaba.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:16:05 +0800 [thread overview]
Message-ID: <87le42b9l6.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <f467d0e9a021f4bd95588b9d888f1740fab3e3bc.1716285099.git.baolin.wang@linux.alibaba.com> (Baolin Wang's message of "Tue, 21 May 2024 19:03:11 +0800")
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.
If so, how about fix this in another direction? That is, remove "ANON"
from mTHP swapout statistics?
> #endif
> count_vm_events(PSWPOUT, folio_nr_pages(folio));
> }
--
Best Regards,
Huang, Ying
next prev parent reply other threads:[~2024-05-22 7:18 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 [this message]
2024-05-22 7:54 ` Baolin Wang
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=87le42b9l6.fsf@yhuang6-desk2.ccr.corp.intel.com \
--to=ying.huang@intel.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--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=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