Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] mm/damon/sysfs: refactor state input matching
@ 2026-11-26 21:06 SJ Park
  2026-11-26 21:06 ` [RFC PATCH 1/4] mm/damon/sysfs: define damon_sysfs_cmd_name type and array SJ Park
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: SJ Park @ 2026-11-26 21:06 UTC (permalink / raw)
  Cc: SJ Park, Andrew Morton, damon, linux-mm

DAMON sysfs interface uses an array of strings, damon_sysfs_cmd_strs,
for kdamond state file input matching.  The array has expected input
strings in an order that matches that of enum damon_sysfs_cmd.

It is easy to mistakenly make the order broken.  Other file input
handling functions use dedicated structs for such matching.  Use the
pattern for kdamond state file.

Define a dedicated struct for the matching, and an array of the structs
for the existing inputs, via patch 1.  Change kdamond state file write
and read handling functions to use the array of the new struct, via
patches 2 and 3.  Finally, remove the input string array,
damon_sysfs_cmd_strs, which is no more being used, via patch 4.

SJ Park (4):
  mm/damon/sysfs: define damon_sysfs_cmd_name type and array
  mm/damon/sysfs: use damon_sysfs_cmd_names in state_store()
  mm/damon/sysfs: use damon_sysfs_cmd_names in state_show()
  mm/damon/sysfs: remove damon_sysfs_cmd_strs

 mm/damon/sysfs.c | 83 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 64 insertions(+), 19 deletions(-)


base-commit: 4aaac77f3cfbdce8de54359c1db84b5322ee5e1b
-- 
2.47.3


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

end of thread, other threads:[~2026-11-26 21:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 21:06 [RFC PATCH 0/4] mm/damon/sysfs: refactor state input matching SJ Park
2026-11-26 21:06 ` [RFC PATCH 1/4] mm/damon/sysfs: define damon_sysfs_cmd_name type and array SJ Park
2026-11-26 21:06 ` [RFC PATCH 2/4] mm/damon/sysfs: use damon_sysfs_cmd_names in state_store() SJ Park
2026-11-26 21:06 ` [RFC PATCH 3/4] mm/damon/sysfs: use damon_sysfs_cmd_names in state_show() SJ Park
2026-11-26 21:06 ` [RFC PATCH 4/4] mm/damon/sysfs: remove damon_sysfs_cmd_strs SJ Park

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