All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Honggyu Kim <honggyu.kim@sk.com>,
	Hyeongtak Ji <hyeongtak.ji@sk.com>,
	damon@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, stable@vger.kernel.org
Subject: Re: [PATCH] mm/damon/ops-common: ignore migration request to invalid nodes
Date: Mon, 21 Jul 2025 09:30:37 -0700	[thread overview]
Message-ID: <20250721163037.9920-1-sj@kernel.org> (raw)
In-Reply-To: <20250721152828.423605-1-joshua.hahnjy@gmail.com>

On Mon, 21 Jul 2025 08:28:26 -0700 Joshua Hahn <joshua.hahnjy@gmail.com> wrote:

> On Sun, 20 Jul 2025 11:58:22 -0700 SeongJae Park <sj@kernel.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@vger.kernel.org
> > Cc: Honggyu Kim <honggyu.kim@sk.com>
> > Signed-off-by: SeongJae Park <sj@kernel.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@gmail.com>

Thank you!

> 
> Sent using hkml (https://github.com/sjp38/hackermail)

Thanks,
SJ

  reply	other threads:[~2025-07-21 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-20 18:58 [PATCH] mm/damon/ops-common: ignore migration request to invalid nodes SeongJae Park
2025-07-21 15:28 ` Joshua Hahn
2025-07-21 16:30   ` SeongJae Park [this message]
2025-07-22  2:56 ` Andrew Morton
2025-07-22  3:04   ` SeongJae Park

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=20250721163037.9920-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=honggyu.kim@sk.com \
    --cc=hyeongtak.ji@sk.com \
    --cc=joshua.hahnjy@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.