All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.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 20:04:31 -0700	[thread overview]
Message-ID: <20250722030431.56507-1-sj@kernel.org> (raw)
In-Reply-To: <20250721195658.935f5e2436045cc311575c9c@linux-foundation.org>

On Mon, 21 Jul 2025 19:56:58 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:

> On Sun, 20 Jul 2025 11:58:22 -0700 SeongJae Park <sj@kernel.org> wrote:
> 
[...]
> > 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
> >
> > ...
> >
> > --- a/mm/damon/ops-common.c
> > +++ b/mm/damon/ops-common.c
> > @@ -383,6 +383,10 @@ unsigned long damon_migrate_pages(struct list_head *folio_list, int target_nid)
> >  	if (list_empty(folio_list))
> >  		return nr_migrated;
> >  
> > +	if (target_nid < 0 || target_nid >= MAX_NUMNODES ||
> > +			!node_state(target_nid, N_MEMORY))
> > +		return nr_migrated;
> > +
> >  	noreclaim_flag = memalloc_noreclaim_save();
> >  
> >  	nid = folio_nid(lru_to_folio(folio_list));
> > 
> 
> OK.  damon_migrate_pages() exists only in mm.git thanks to 13dde31db71f
> ("mm/damon: move migration helpers from paddr to ops-common").  I
> assume that you'll send the -stable people a patch which adds this check into
> damon_pa_migrate_pages() when called upon to do so.

That's very correct, Andrew.  I am planning to do so as soon as this is merged
into the mainline :)


Thanks,
SJ

      reply	other threads:[~2025-07-22  3:04 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
2025-07-22  2:56 ` Andrew Morton
2025-07-22  3:04   ` SeongJae Park [this message]

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=20250722030431.56507-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=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.