mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] mm/damon: fix three race bugs in sysfs and core
@ 2026-10-25 16:48 SJ Park
  2026-10-25 16:48 ` [PATCH 1/3] mm/damon/sysfs-schemes: hold damon_sysfs_lock in target_metric_store() SJ Park
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: SJ Park @ 2026-10-25 16:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SJ Park, stable, Fernand Sieber, Jiayuan Chen, SeongJae Park,
	damon, linux-kernel, linux-mm

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/20261024193351.87130-1-sj@kernel.org
- 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
-- 
2.47.3

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-25 16:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 16:48 [PATCH 0/3] mm/damon: fix three race bugs in sysfs and core SJ Park
2026-10-25 16:48 ` [PATCH 1/3] mm/damon/sysfs-schemes: hold damon_sysfs_lock in target_metric_store() SJ Park
2026-10-25 16:48 ` [PATCH 2/3] mm/damon/core: move static variable last_nr_regions to damon_ctx SJ Park
2026-10-25 16:48 ` [PATCH 3/3] mm/damon/core: move static variable rotation " SJ Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®