Skip to content

mm/damon: fix three race bugs in sysfs and core

SJ Park damon linux-mm lkml stable 1 version Applied

Status from this message: [merged mm-hotfixes-stable] mm-damon-core-move-static-variable-rotation-to-damon_ctx.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3mm/damon/sysfs-schemes: hold damon_sysfs_lock in target_metric_store()mm/damon/sysfs-schemes.c+3 -00 repliesApplied
2/3mm/damon/core: move static variable last_nr_regions to damon_ctxinclude/linux/damon.h mm/damon/core.c+7 -30 repliesApplied
3/3mm/damon/core: move static variable rotation to damon_ctxinclude/linux/damon.h mm/damon/core.c+8 -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/3] mm/damon: fix three race bugs in sysfs and core

There are three race condition bugs in DAMON sysfs interface and the core layer. User impacts are not critical but better to fix sooner than later.

Patch 1 fixes a toctou bug in DAMON sysfs interface that can mess up DAMOS auto-tuning. Patches 2 and 3 move static variables that can be wrongly shared with multiple kdamonds and therefore make DAMON monitoring results be a little more indeterministic.

Note for Andrew. These are not urgent but better to take the hotfix track in my humble opinion.

Changes from RFC
- RFC: https://lore.kernel.org/[email protected]
- Rebase to latest mm-new.
- Drop RFC tag.

SJ Park (3):
mm/damon/sysfs-schemes: hold damon_sysfs_lock in target_metric_store() mm/damon/core: move static variable last_nr_regions to damon_ctx mm/damon/core: move static variable rotation to damon_ctx

 include/linux/damon.h    | 10 ++++++++++
 mm/damon/core.c          | 10 +++++-----
 mm/damon/sysfs-schemes.c |  3 +++
 3 files changed, 18 insertions(+), 5 deletions(-)

base-commit: 34b81edd2a3300a88493222637ea010223c00ecd

Signature · 1 line
2.47.3