mm/damon/sysfs: implement a command for updating only schemes tried total bytes
authorSeongJae Park <sj@kernel.org>
Wed, 2 Aug 2023 21:32:18 +0000 (21:32 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 21 Aug 2023 20:37:34 +0000 (13:37 -0700)
commit6ad243b83b5094026fdb3171711ddb25246b3d8a
tree92fac83fbbb5c6a3b4f47ba8b5d89462c3d18222
parentb69f92a741405336fb17a8a3d67fc144192fe8e2
mm/damon/sysfs: implement a command for updating only schemes tried total bytes

Using tried_regions/total_bytes file, users can efficiently retrieve the
total size of memory regions having specific access pattern.  However,
DAMON sysfs interface in kernel still populates all the infomration on the
tried_regions subdirectories.  That means the kernel part overhead for the
construction of tried regions directories still exists.  To remove the
overhead, implement yet another command input for 'state' DAMON sysfs
file.  Writing the input to the file makes DAMON sysfs interface to update
only the total_bytes file.

Link: https://lkml.kernel.org/r/20230802213222.109841-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/sysfs-common.h
mm/damon/sysfs-schemes.c
mm/damon/sysfs.c