[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250721163037.9920-1-sj@kernel.org>
Date: Mon, 21 Jul 2025 09:30:37 -0700
From: SeongJae Park <sj@...nel.org>
To: Joshua Hahn <joshua.hahnjy@...il.com>
Cc: SeongJae Park <sj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Honggyu Kim <honggyu.kim@...com>,
Hyeongtak Ji <hyeongtak.ji@...com>,
damon@...ts.linux.dev,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
stable@...r.kernel.org
Subject: Re: [PATCH] mm/damon/ops-common: ignore migration request to invalid nodes
On Mon, 21 Jul 2025 08:28:26 -0700 Joshua Hahn <joshua.hahnjy@...il.com> wrote:
> On Sun, 20 Jul 2025 11:58:22 -0700 SeongJae Park <sj@...nel.org> wrote:
>
> > damon_migrate_pages() try migration even if the target node is invalid.
> > If users mistakenly make such invalid requests via
> > DAMOS_MIGRATE_{HOT,COLD} action, below kernel BUG can happen.
[...]
> > Add a target node validity check in damon_migrate_pages(). The validity
> > check is stolen from that of do_pages_move(), which is being used for
> > move_pages() system call.
> >
> > Fixes: b51820ebea65 ("mm/damon/paddr: introduce DAMOS_MIGRATE_COLD action for demotion") # 6.11.x
> > Cc: stable@...r.kernel.org
> > Cc: Honggyu Kim <honggyu.kim@...com>
> > Signed-off-by: SeongJae Park <sj@...nel.org>
> > ---
>
> LGTM, thank you SJ!
>
> On a side note... This seems like it would be a common check. However, doing a
> (quick) search seems to return no function that checks whether a node is valid.
> Perhaps it would make sense to look deeper and see how many other functions
> make this check, and export this as a function? I can try spinning something
> if it makes sense to you : -)
My humble impression was that this check is short enough to be ok to be
open-coded, but please don't be blocked on my opinion :)
>
> Reviewed-by: Joshua Hahn <joshua.hahnjy@...il.com>
Thank you!
>
> Sent using hkml (https://github.com/sjp38/hackermail)
Thanks,
SJ
Powered by blists - more mailing lists