linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>,
	damon@lists.linux.dev, kernel-team@meta.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	stable@vger.kernel.org
Subject: [PATCH 0/6] mm/damon: fix misc bugs in DAMON modules
Date: Sun,  6 Jul 2025 12:32:01 -0700	[thread overview]
Message-ID: <20250706193207.39810-1-sj@kernel.org> (raw)

From manual code review, I found below bugs in DAMON modules.

DAMON sample modules crash if those are enabled at boot time, via kernel
command line.  A similar issue was found and fixed on DAMON non-sample
modules in the past, but we didn't check that for sample modules.

DAMON non-sample modules are not setting 'enabled' parameters
accordingly when real enabling is failed.  Honggyu found and fixed[1]
this type of bugs in DAMON sample modules, and my inspection was
motivated by the great work.  Kudos to Honggyu.

Finally, DAMON_RECLIAM is mistakenly losing scheme internal status due
to misuse of damon_commit_ctx().  DAMON_LRU_SORT has a similar misuse,
but fortunately it is not causing real status loss.

Fix the bugs.  Since these are similar patterns of bugs that were found
in the past, it would be better to add tests or refactor the code, in
future.

Note that the fix of the second bug for DAMON_STAT is sent
separately[2], since it is a fix for a bug in mm-unstable tree at the
moment.  Also as mentioned above, DAMON_LRU_SORT also has a misuse of
damon_commit_ctx(), but it is not causing a real issue, hence the fix is
not included in this series.  I will post it later.

[1] https://lore.kernel.org/20250702000205.1921-1-honggyu.kim@sk.com
[2] https://lore.kernel.org/20250706184750.36588-1-sj@kernel.org

SeongJae Park (6):
  samples/damon/wsse: fix boot time enable handling
  samples/damon/prcl: fix boot time enable crash
  samples/damon/mtier: support boot time enable setup
  mm/damon/reclaim: reset enabled when DAMON start failed
  mm/damon/lru_sort: reset enabled when DAMON start failed
  mm/damon/reclaim: use parameter context correctly

 mm/damon/lru_sort.c   |  5 ++++-
 mm/damon/reclaim.c    |  9 ++++++---
 samples/damon/mtier.c | 13 +++++++++++++
 samples/damon/prcl.c  | 13 +++++++++++++
 samples/damon/wsse.c  | 15 ++++++++++++++-
 5 files changed, 50 insertions(+), 5 deletions(-)


base-commit: a555ad24c884e9f4ee2f2a0184f5b7b89c8d4a6e
-- 
2.39.5


             reply	other threads:[~2025-07-06 19:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-06 19:32 SeongJae Park [this message]
2025-07-06 19:32 ` [PATCH 1/6] samples/damon/wsse: fix boot time enable handling SeongJae Park
2025-07-06 19:32 ` [PATCH 2/6] samples/damon/prcl: fix boot time enable crash SeongJae Park
2025-07-06 19:32 ` [PATCH 3/6] samples/damon/mtier: support boot time enable setup SeongJae Park
2025-07-06 19:32 ` [PATCH 4/6] mm/damon/reclaim: reset enabled when DAMON start failed SeongJae Park
2025-07-06 19:32 ` [PATCH 5/6] mm/damon/lru_sort: " SeongJae Park
2025-07-06 19:32 ` [PATCH 6/6] mm/damon/reclaim: use parameter context correctly 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=20250706193207.39810-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=kernel-team@meta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).