Skip to content

mm/damon: fix misc bugs in DAMON modules

SeongJae Park damon linux-mm lkml stable 1 version Applied

Status from this message: [merged mm-stable] mm-damon-reclaim-use-parameter-context-correctly.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesApplied 6/6

Patches in v1 All 6 applied

#Subject and filesSizeRepliesApplied
1/6samples/damon/wsse: fix boot time enable handlingsamples/damon/wsse.c+14 -10 repliesApplied
2/6samples/damon/prcl: fix boot time enable crashsamples/damon/prcl.c+13 -00 repliesApplied
3/6samples/damon/mtier: support boot time enable setupsamples/damon/mtier.c+13 -00 repliesApplied
4/6mm/damon/reclaim: reset enabled when DAMON start failedmm/damon/reclaim.c+4 -10 repliesApplied
5/6mm/damon/lru_sort: reset enabled when DAMON start failedmm/damon/lru_sort.c+4 -10 repliesApplied
6/6mm/damon/reclaim: use parameter context correctlymm/damon/reclaim.c+2 -20 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] mm/damon: fix misc bugs in DAMON modules

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/[email protected]
[2] https://lore.kernel.org/[email protected]

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

Signature · 1 line
2.39.5