public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: SeongJae Park <sj@kernel.org>
Cc: Liew Rui Yan <aethernet65535@gmail.com>,
	damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [PATCH v2] mm/damon: validate min_region_size to be power of 2
Date: Thu,  2 Apr 2026 08:29:14 -0700	[thread overview]
Message-ID: <20260402152915.75294-1-sj@kernel.org> (raw)
In-Reply-To: <20260402140314.74600-1-sj@kernel.org>

On Thu,  2 Apr 2026 07:03:14 -0700 SeongJae Park <sj@kernel.org> wrote:

> On Thu,  2 Apr 2026 13:37:56 +0800 Liew Rui Yan <aethernet65535@gmail.com> wrote:
> 
> > Problem
> > =======
> > damon_commit_ctx() checks if 'min_region_sz' is a power of 2. But if it
> > is not, kdamond will terminate unexpectedly due to the user's invalid
> > input.
> 
> Could you please further elaborate visible user impact of the problem and
> reproduction steps if available?
> 
> > 
> > Solution
> > ========
> > Add the same check to damon_{lru_sort, reclaim}_apply_parameters(), but
> > return -EINVAL immediately. This is to prevent user's invalid input
> > causing kdamond to terminate unexpectedly.
> > 
> > This patch is a follow-up to the discussion in [1], where we agreed that
> > the validation should be done on min_region_sz rather than addr_unit.
> > 
> > [1] https://lore.kernel.org/20260330233343.4083-1-sj@kernel.org
> > 
> 
> Should we add Fixes: and Cc: stable@ ?
> 
> If we should Cc: stable@, and if the changes for DAMON_RECLAIM and
> DAMON_LRU_SORT deserve different Fixes:, I think this patch is better to be
> split into two patches, one for DAMON_RECLAIM, and the other for
> DAMON_LRU_SORT.
> 
> > Signed-off-by: Liew Rui Yan <aethernet65535@gmail.com>
> > ---
> > Changes from v1:
> > - Fix memory leak issue.
> > - Link to v1: https://lore.kernel.org/20260331073231.30060-1-aethernet65535@gmail.com
> 
> Seems you forgot the patch [1] before renaming of the subject.

Also, if you have posted RFCs or another different subject patches before,
please add full change log.

We are dealing with multiple patches in parallel, so I'm not fully following
entire contexts.  Please understand.

> 
> [...]
> 
> The code changes look good to me.
> 
> [1] https://lore.kernel.org/20260327062627.66426-1-aethernet65535@gmail.com


Thanks,
SJ

[...]


  reply	other threads:[~2026-04-02 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02  5:37 [PATCH v2] mm/damon: validate min_region_size to be power of 2 Liew Rui Yan
2026-04-02  7:08 ` (sashiko status) " Liew Rui Yan
2026-04-02 14:03 ` SeongJae Park
2026-04-02 15:29   ` SeongJae Park [this message]
2026-04-03  8:29   ` Liew Rui Yan
2026-04-03 14:09     ` SeongJae Park
2026-04-03 14:12       ` 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=20260402152915.75294-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=aethernet65535@gmail.com \
    --cc=damon@lists.linux.dev \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox