From: Peter Xu <peterx@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Zi Yan <ziy@nvidia.com>, Yang Shi <shy828301@gmail.com>,
Hugh Dickins <hughd@google.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Huang Ying <ying.huang@intel.com>,
David Hildenbrand <david@redhat.com>
Subject: Re: [PATCH] mm/migrate: Putback split folios when numa hint migration fails
Date: Tue, 9 Jul 2024 10:47:19 -0400 [thread overview]
Message-ID: <Zo1Nd_aLq_tFDMoc@x1n> (raw)
In-Reply-To: <20240708160407.a0c51eb11d0403c161d27540@linux-foundation.org>
On Mon, Jul 08, 2024 at 04:04:07PM -0700, Andrew Morton wrote:
> On Mon, 8 Jul 2024 17:55:37 -0400 Peter Xu <peterx@redhat.com> wrote:
>
> > This issue is not from any report yet, but by code observation only.
> >
> > This is yet another fix besides Hugh's patch [1] but on relevant code path,
> > where eager split of folio can happen if the folio is already on deferred
> > list during a folio migration.
> >
> > Here the issue is NUMA path (migrate_misplaced_folio()) may start to
> > encounter such folio split now even with MR_NUMA_MISPLACED hint applied.
> > Then when migrate_pages() didn't migrate all the folios, it's possible the
> > split small folios be put onto the list instead of the original folio.
> > Then putting back only the head page won't be enough.
> >
> > Fix it by putting back all the folios on the list.
>
> mm/migrate.c: In function 'migrate_misplaced_folio':
> mm/migrate.c:2624:13: error: unused variable 'nr_pages' [-Werror=unused-variable]
> 2624 | int nr_pages = folio_nr_pages(folio);
> | ^~~~~~~~
>
> Worrisome. Which kernel version was this tested against?
mm-unstable (and on top of a few of my other totally irrelevant patches),
and I thought it also applied to mm-stable.
Totally missed this warning when still with WERROR=off locally when
building against this patch, my apologies.
>
> > Don't need to copy stable if this can still hit 6.10.. Only smoke tested.
>
> Also worrisome. Are we to take an only-smoke-tested patch which
> doesn't apply to mainline and which doesn't compile on mm-unstable into
> mainline based on "only smoke tested"?
Hmm so it doesn't apply to mainline.. For the smoke test part, I was not
confident to reproduce it, and I just stumbled over it when looking at the
real BUG_ON we hit. I thought it might be a good idea to send a patch
before everyone forgets about it.
I think it is easily overlooked probably because the issue wasn't
obvious. IIUC the sympton of hitting it should be that we leak a few of
those tail pages even if they're freed in the future from the mappings. I
am not sure how much an issue with keep being !lru for them besides the
leaked refcounts, perhaps only vmscan won't see them. After all, all these
is based on the chance of hitting this case and it should be rare. I don't
think I know well enough to say.
Considering that nobody yelled after rc5 until now, and this is only
something I observed when looking at the more severe issue Hugh fixed..
maybe we should target this for next release, then stablize it and wait for
a backport to 6.10?
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2024-07-09 14:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-08 21:55 Peter Xu
2024-07-08 21:58 ` Zi Yan
2024-07-08 23:04 ` Andrew Morton
2024-07-09 14:47 ` Peter Xu [this message]
2024-07-09 21:01 ` Andrew Morton
2024-07-09 1:48 ` Baolin Wang
2024-07-09 14:56 ` Peter Xu
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=Zo1Nd_aLq_tFDMoc@x1n \
--to=peterx@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shy828301@gmail.com \
--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