Skip to content

mm/damon/sysfs: fix refresh_ms control overwriting on multi-kdamonds usages

SeongJae Park damon linux-mm lkml 1 version Applied

Status from this message: [merged mm-hotfixes-stable] mm-damon-sysfs-use-dynamically-allocated-repeat-mode-damon_call_control.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2mm/damon/core: introduce damon_call_control->dealloc_on_cancelinclude/linux/damon.h mm/damon/core.c+8 -20 repliesApplied
2/2mm/damon/sysfs: use dynamically allocated repeat mode damon_call_controlmm/damon/sysfs.c+15 -80 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/2] mm/damon/sysfs: fix refresh_ms control overwriting on multi-kdamonds usages

Automatic esssential DAMON/DAMOS status update feature of DAMON sysfs interface (refresh_ms) is broken [1] for multiple DAMON contexts (kdamonds) use case, since it uses a global single damon_call_control object for all created DAMON contexts. The fields of the object, particularly the list field is over-written for the contexts and it makes unexpected results including user-space hangup and kernel crashes [2]. Fix it by extending damon_call_control for the use case and updating the usage on DAMON sysfs interface to use per-context dynamically allocated damon_call_control object.

[1] https://lore.kernel.org/[email protected]
[2] https://lore.kernel.org/[email protected]

SeongJae Park (2):
mm/damon/core: introduce damon_call_control->dealloc_on_cancel mm/damon/sysfs: use dynamically allocated repeat mode
damon_call_control

 include/linux/damon.h |  2 ++
 mm/damon/core.c       |  8 ++++++--
 mm/damon/sysfs.c      | 23 +++++++++++++++--------
 3 files changed, 23 insertions(+), 10 deletions(-)

base-commit: c6680f5947fa5ff95bc881f2c4e36443478c8829

Signature · 1 line
2.39.5