From: Barry Song <21cnbao@gmail.com>
To: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: akpm@linux-foundation.org, david@redhat.com,
ying.huang@linux.alibaba.com, ziy@nvidia.com,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: migrate: drop redundant anonymous statistics for file folios migration
Date: Thu, 5 Dec 2024 19:33:27 +1300 [thread overview]
Message-ID: <CAGsJ_4xZDrCSjv5NA7T_yDyjKbCB8XsADPQxCnq2qRO8gU=VaA@mail.gmail.com> (raw)
In-Reply-To: <48fe508d-ecb9-4607-aab6-cc18b4bc78e9@linux.alibaba.com>
On Thu, Dec 5, 2024 at 7:06 PM Baolin Wang
<baolin.wang@linux.alibaba.com> wrote:
>
>
>
> On 2024/12/5 13:00, Barry Song wrote:
> > On Thu, Dec 5, 2024 at 4:54 PM Baolin Wang
> > <baolin.wang@linux.alibaba.com> wrote:
> >>
> >> Commit 5d65c8d758f2 ("mm: count the number of anonymous THPs per size") adds
> >> a new anonymous counter per THP size, however, when folio_mapping() is not NULL
> >> during folio migration, it means this is not an anonymous folio, so remove the
> >> redundant anonymous statistics in this case.
> >
> > why? Are you sure anon folios won't call __folio_migrate_mapping()?
> > folio->mapping is PAGE_MAPPING_ANON for anon folios.
> >
> > static __always_inline bool folio_test_anon(const struct folio *folio)
> > {
> > return ((unsigned long)folio->mapping & PAGE_MAPPING_ANON) != 0;
> > }
>
> Ah, sorry for noise. This just caught my eyes when reading the code, and
> I did not think about it deeply before sending a quick patch. Thanks to
> Barry and Ying for the reminder.
No worries. I recall encountering a negative count during the development of
the original patch and eventually realizing it was due to forgetting
to increment
the migrated anon folios. Your patch seems to reintroduce the bug I encountered
back then :-)
>
> Andrew, please drop this quick patch. Sorry for the trouble.
>
Thanks
Barry
next prev parent reply other threads:[~2024-12-05 6:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 3:53 Baolin Wang
2024-12-05 5:00 ` Barry Song
2024-12-05 6:06 ` Baolin Wang
2024-12-05 6:33 ` Barry Song [this message]
2024-12-05 6:50 ` Baolin Wang
2024-12-05 5:39 ` Huang, Ying
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='CAGsJ_4xZDrCSjv5NA7T_yDyjKbCB8XsADPQxCnq2qRO8gU=VaA@mail.gmail.com' \
--to=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ying.huang@linux.alibaba.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