mm/damon/sysfs-schemes: implement DAMOS action destinations directory
authorSeongJae Park <sj@kernel.org>
Wed, 9 Jul 2025 00:59:33 +0000 (19:59 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 01:59:48 +0000 (18:59 -0700)
commit2cd0bf85a203e21f7bc93628441f136fc2d0a2b8
treeafef94428588c5ba8bdabeb81518b0868f08c91c
parentaabc85ee33c883243f2c506a5d88963f2456faa6
mm/damon/sysfs-schemes: implement DAMOS action destinations directory

DAMOS_MIGRATE_{HOT,COLD} can have multiple action destinations and their
weights.  Implement sysfs directory named 'dests' under each scheme
directory to let DAMON sysfs ABI users utilize the feature.  The interface
is similar to other multiple parameters directory like kdamonds or
filters.  The directory contains only nr_dests file initially.  Writing a
number of desired destinations to nr_dests creates directories of the
number.  Each of the created directories has two files named id and
weight.  Users can then write the destination's identifier (node id in
case of DAMOS_MIGRATE_*) and weight to the files.

Link: https://lkml.kernel.org/r/20250709005952.17776-4-bijan311@gmail.com
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Bijan Tabatabai <bijantabatab@micron.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Ravi Shankar Jonnalagadda <ravis.opensrc@micron.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/sysfs-schemes.c