1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-20 05:13:55 +00:00
SeongJae Park e6a0deb6fa mm/damon/core: introduce damon_call_control->dealloc_on_cancel
Patch series "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.


This patch (of 2):

When damon_call_control->repeat is set, damon_call() is executed
asynchronously, and is eventually canceled when kdamond finishes.  If the
damon_call_control object is dynamically allocated, finding the place to
deallocate the object is difficult.  Introduce a new damon_call_control
field, namely dealloc_on_cancel, to ask the kdamond deallocates those
dynamically allocated objects when those are canceled.

Link: https://lkml.kernel.org/r/20250908201513.60802-3-sj@kernel.org
Link: https://lkml.kernel.org/r/20250908201513.60802-2-sj@kernel.org
Fixes: d809a7c64ba8 ("mm/damon/sysfs: implement refresh_ms file internal work")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Yunjeong Mun <yunjeong.mun@sk.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-13 13:05:36 -07:00
..
2025-07-29 11:42:31 -07:00
2025-07-31 11:50:25 -07:00
2025-07-31 13:43:02 -07:00
2025-07-31 16:29:46 -07:00
2025-08-02 12:07:09 -07:00
2025-07-31 13:43:02 -07:00
2025-08-09 07:20:44 +03:00
2025-07-31 13:16:09 -07:00
2025-07-29 20:21:54 -07:00
2025-07-31 11:28:03 -04:00
2025-07-31 18:23:53 -07:00
2025-08-01 15:47:06 -07:00
2025-07-29 17:42:52 -07:00
2025-07-31 16:52:32 -07:00
2025-07-29 12:15:39 -07:00
2025-08-09 18:10:01 +03:00
2025-07-30 09:58:50 -07:00
2025-08-04 16:27:21 -07:00
2025-07-24 19:12:32 -07:00
2025-07-28 16:30:12 -07:00
2025-08-02 12:06:10 -07:00
2025-07-31 12:43:08 -07:00
2025-07-30 17:14:01 -07:00
2025-08-06 07:32:52 +03:00
2025-08-06 07:32:52 +03:00
2025-07-30 17:14:01 -07:00
2025-08-01 15:47:06 -07:00
2025-07-30 16:23:12 -07:00
2025-07-31 16:11:43 -05:00
2025-07-29 11:42:31 -07:00
2025-08-03 15:03:04 -07:00
2025-07-28 18:20:32 -07:00
2025-07-29 13:00:20 -07:00
2025-08-04 10:54:36 -07:00
2025-07-30 19:26:49 -07:00
Hi,
2025-07-28 18:18:16 -07:00
2025-08-01 14:17:48 -07:00
2025-08-02 12:01:37 -07:00