linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable
@ 2024-01-30  1:35 SeongJae Park
  2024-01-30  1:35 ` [PATCH 1/9] Docs/admin-guide/mm/damon/usage: use sysfs interface for tracepoints example SeongJae Park
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Jonathan Corbet, Shuah Khan, Alex Shi, Hu Haowen,
	Yanteng Si, damon, linux-mm, linux-doc, linux-kselftest,
	linux-kernel

DAMON debugfs interface is deprecated in February 2023, by commit
5445fcbc4cda ("Docs/admin-guide/mm/damon/usage: add DAMON debugfs
interface deprecation notice").  Make the fact unable to be easily
ignored by removing an example usage from the document (patch 1),
renaming the config (patch 2), adding a deprecation notice file to the
debugfs directory (patches 3-5), and renaming the debugfs file that
essnetial to be used for real use of DAMON (patches 6-9).

SeongJae Park (9):
  Docs/admin-guide/mm/damon/usage: use sysfs interface for tracepoints
    example
  mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED
  mm/damon/dbgfs: implement deprecation notice file
  mm/damon/dbgfs: make debugfs interface deprecation message a macro
  Docs/admin-guide/mm/damon/usage: document 'DEPRECATED' file of DAMON
    debugfs interface
  selftets/damon: prepare for monitor_on file renaming
  mm/damon/dbgfs: rename monitor_on file to monitor_on_DEPRECATED
  Docs/admin-guide/mm/damon/usage: update for monitor_on renaming
  Docs/translations/damon/usage: update for monitor_on renaming

 Documentation/admin-guide/mm/damon/usage.rst  | 42 +++++++++++--------
 .../zh_CN/admin-guide/mm/damon/usage.rst      | 20 ++++-----
 .../zh_TW/admin-guide/mm/damon/usage.rst      | 20 ++++-----
 mm/damon/Kconfig                              |  7 +++-
 mm/damon/dbgfs.c                              | 27 +++++++++---
 .../selftests/damon/_chk_dependency.sh        | 11 ++++-
 .../selftests/damon/_debugfs_common.sh        |  7 ++++
 .../selftests/damon/debugfs_empty_targets.sh  | 12 +++++-
 8 files changed, 98 insertions(+), 48 deletions(-)


base-commit: f1ab2f51e99ffb94ce127d132b24be00dc130e6c
-- 
2.39.2



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

* [PATCH 1/9] Docs/admin-guide/mm/damon/usage: use sysfs interface for tracepoints example
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  2024-01-30  1:35 ` [PATCH 2/9] mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED SeongJae Park
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Jonathan Corbet, damon, linux-mm, linux-doc,
	linux-kernel

DAMON tracepoints example on the DAMON usage document is using DAMON
debugfs interface, which is deprecated.  Use its alternative, DAMON
sysfs interface.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/admin-guide/mm/damon/usage.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index 9d23144bf985..f2feabb4bd35 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -579,11 +579,11 @@ monitoring results recording.
 While the monitoring is turned on, you could record the tracepoint events and
 show results using tracepoint supporting tools like ``perf``.  For example::
 
-    # echo on > monitor_on
+    # echo on > kdamonds/0/state
     # perf record -e damon:damon_aggregated &
     # sleep 5
     # kill 9 $(pidof perf)
-    # echo off > monitor_on
+    # echo off > kdamonds/0/state
     # perf script
     kdamond.0 46568 [027] 79357.842179: damon:damon_aggregated: target_id=0 nr_regions=11 122509119488-135708762112: 0 864
     [...]
-- 
2.39.2



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

* [PATCH 2/9] mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
  2024-01-30  1:35 ` [PATCH 1/9] Docs/admin-guide/mm/damon/usage: use sysfs interface for tracepoints example SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  2024-01-30  1:35 ` [PATCH 3/9] mm/damon/dbgfs: implement deprecation notice file SeongJae Park
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, damon, linux-mm, linux-kernel

DAMON debugfs interface is deprecated.  The fact has documented by
commit 5445fcbc4cda ("Docs/admin-guide/mm/damon/usage: add DAMON debugfs
interface deprecation notice").  Commit 620932cd2852 ("mm/damon/dbgfs:
print DAMON debugfs interface deprecation message") further started
printing a warning message when users still use it.  Many people don't
read documentation or kernel log, though.

Make the deprecation harder to be ignored using the approach of commit
eb07c4f39c3e ("mm/slab: rename CONFIG_SLAB to CONFIG_SLAB_DEPRECATED").
'make oldconfig' with 'CONFIG_DAMON_DBGFS=y' will get a new prompt with
the explicit deprecation notice on the name.  'make olddefconfig' with
'CONFIG_DAMON_DBGFS=y' will result in not building DAMON debugfs
interface.  If there is a real user of DAMON debugfs interface, they
will complain the change to the builder.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/Kconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/mm/damon/Kconfig b/mm/damon/Kconfig
index 29f43fbc2eff..fecb8172410c 100644
--- a/mm/damon/Kconfig
+++ b/mm/damon/Kconfig
@@ -71,7 +71,7 @@ config DAMON_SYSFS_KUNIT_TEST
 
 	  If unsure, say N.
 
-config DAMON_DBGFS
+config DAMON_DBGFS_DEPRECATED
 	bool "DAMON debugfs interface (DEPRECATED!)"
 	depends on DAMON_VADDR && DAMON_PADDR && DEBUG_FS
 	help
@@ -84,6 +84,11 @@ config DAMON_DBGFS
 	  (DAMON_SYSFS).  If you depend on this and cannot move, please report
 	  your usecase to damon@lists.linux.dev and linux-mm@kvack.org.
 
+config DAMON_DBGFS
+	bool
+	default y
+	depends on DAMON_DBGFS_DEPRECATED
+
 config DAMON_DBGFS_KUNIT_TEST
 	bool "Test for damon debugfs interface" if !KUNIT_ALL_TESTS
 	depends on DAMON_DBGFS && KUNIT=y
-- 
2.39.2



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

* [PATCH 3/9] mm/damon/dbgfs: implement deprecation notice file
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
  2024-01-30  1:35 ` [PATCH 1/9] Docs/admin-guide/mm/damon/usage: use sysfs interface for tracepoints example SeongJae Park
  2024-01-30  1:35 ` [PATCH 2/9] mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  2024-01-30  1:35 ` [PATCH 4/9] mm/damon/dbgfs: make debugfs interface deprecation message a macro SeongJae Park
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, damon, linux-mm, linux-kernel

Implement a read-only file for DAMON debugfs interface deprecation
notice, to let users who manually read/write the DAMON debugfs files
from their shell command line easily notice the fact.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/dbgfs.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index 7dac24e69e3b..fc6ece5a9f37 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -805,6 +805,18 @@ static void dbgfs_destroy_ctx(struct damon_ctx *ctx)
 	damon_destroy_ctx(ctx);
 }
 
+static ssize_t damon_dbgfs_deprecated_read(struct file *file,
+		char __user *buf, size_t count, loff_t *ppos)
+{
+	char kbuf[512] = "DAMON debugfs interface is deprecated, "
+		     "so users should move to DAMON_SYSFS. If you cannot, "
+		     "please report your usecase to damon@lists.linux.dev and "
+		     "linux-mm@kvack.org.\n";
+	int len = strnlen(kbuf, 1024);
+
+	return simple_read_from_buffer(buf, count, ppos, kbuf, len);
+}
+
 /*
  * Make a context of @name and create a debugfs directory for it.
  *
@@ -1056,6 +1068,10 @@ static int damon_dbgfs_static_file_open(struct inode *inode, struct file *file)
 	return nonseekable_open(inode, file);
 }
 
+static const struct file_operations deprecated_fops = {
+	.read = damon_dbgfs_deprecated_read,
+};
+
 static const struct file_operations mk_contexts_fops = {
 	.open = damon_dbgfs_static_file_open,
 	.write = dbgfs_mk_context_write,
@@ -1076,9 +1092,9 @@ static int __init __damon_dbgfs_init(void)
 {
 	struct dentry *dbgfs_root;
 	const char * const file_names[] = {"mk_contexts", "rm_contexts",
-		"monitor_on"};
+		"monitor_on", "DEPRECATED"};
 	const struct file_operations *fops[] = {&mk_contexts_fops,
-		&rm_contexts_fops, &monitor_on_fops};
+		&rm_contexts_fops, &monitor_on_fops, &deprecated_fops};
 	int i;
 
 	dbgfs_root = debugfs_create_dir("damon", NULL);
-- 
2.39.2



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

* [PATCH 4/9] mm/damon/dbgfs: make debugfs interface deprecation message a macro
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
                   ` (2 preceding siblings ...)
  2024-01-30  1:35 ` [PATCH 3/9] mm/damon/dbgfs: implement deprecation notice file SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  2024-01-30  1:35 ` [PATCH 5/9] Docs/admin-guide/mm/damon/usage: document 'DEPRECATED' file of DAMON debugfs interface SeongJae Park
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, damon, linux-mm, linux-kernel

DAMON debugfs interface deprecation message is written twice, once for
the warning, and again for DEPRECATED file's read output.  De-duplicate
those by defining the message as a macro and reuse.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/dbgfs.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index fc6ece5a9f37..fbc0cd63f34c 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -15,6 +15,11 @@
 #include <linux/page_idle.h>
 #include <linux/slab.h>
 
+#define DAMON_DBGFS_DEPRECATION_NOTICE					\
+	"DAMON debugfs interface is deprecated, so users should move "	\
+	"to DAMON_SYSFS. If you cannot, please report your usecase to "	\
+	"damon@lists.linux.dev and linux-mm@kvack.org.\n"
+
 static struct damon_ctx **dbgfs_ctxs;
 static int dbgfs_nr_ctxs;
 static struct dentry **dbgfs_dirs;
@@ -22,10 +27,7 @@ static DEFINE_MUTEX(damon_dbgfs_lock);
 
 static void damon_dbgfs_warn_deprecation(void)
 {
-	pr_warn_once("DAMON debugfs interface is deprecated, "
-		     "so users should move to DAMON_SYSFS. If you cannot, "
-		     "please report your usecase to damon@lists.linux.dev and "
-		     "linux-mm@kvack.org.\n");
+	pr_warn_once(DAMON_DBGFS_DEPRECATION_NOTICE);
 }
 
 /*
@@ -808,10 +810,7 @@ static void dbgfs_destroy_ctx(struct damon_ctx *ctx)
 static ssize_t damon_dbgfs_deprecated_read(struct file *file,
 		char __user *buf, size_t count, loff_t *ppos)
 {
-	char kbuf[512] = "DAMON debugfs interface is deprecated, "
-		     "so users should move to DAMON_SYSFS. If you cannot, "
-		     "please report your usecase to damon@lists.linux.dev and "
-		     "linux-mm@kvack.org.\n";
+	char kbuf[512] = DAMON_DBGFS_DEPRECATION_NOTICE;
 	int len = strnlen(kbuf, 1024);
 
 	return simple_read_from_buffer(buf, count, ppos, kbuf, len);
-- 
2.39.2



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

* [PATCH 5/9] Docs/admin-guide/mm/damon/usage: document 'DEPRECATED' file of DAMON debugfs interface
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
                   ` (3 preceding siblings ...)
  2024-01-30  1:35 ` [PATCH 4/9] mm/damon/dbgfs: make debugfs interface deprecation message a macro SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  2024-01-30  1:35 ` [PATCH 6/9] selftets/damon: prepare for monitor_on file renaming SeongJae Park
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Jonathan Corbet, damon, linux-mm, linux-doc,
	linux-kernel

Document the newly added DAMON debugfs interface deprecation notice file
on the usage document.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/admin-guide/mm/damon/usage.rst | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index f2feabb4bd35..5d3df18dfb9f 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -628,9 +628,16 @@ debugfs Interface (DEPRECATED!)
   move, please report your usecase to damon@lists.linux.dev and
   linux-mm@kvack.org.
 
-DAMON exports eight files, ``attrs``, ``target_ids``, ``init_regions``,
-``schemes``, ``monitor_on``, ``kdamond_pid``, ``mk_contexts`` and
-``rm_contexts`` under its debugfs directory, ``<debugfs>/damon/``.
+DAMON exports nine files, ``DEPRECATED``, ``attrs``, ``target_ids``,
+``init_regions``, ``schemes``, ``monitor_on``, ``kdamond_pid``, ``mk_contexts``
+and ``rm_contexts`` under its debugfs directory, ``<debugfs>/damon/``.
+
+
+``DEPRECATED`` is a read-only file for the DAMON debugfs interface deprecation
+notice.  Reading it returns the deprecation notice, as below::
+
+    # cat DEPRECATED
+    DAMON debugfs interface is deprecated, so users should move to DAMON_SYSFS. If you cannot, please report your usecase to damon@lists.linux.dev and linux-mm@kvack.org.
 
 
 Attributes
-- 
2.39.2



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

* [PATCH 6/9] selftets/damon: prepare for monitor_on file renaming
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
                   ` (4 preceding siblings ...)
  2024-01-30  1:35 ` [PATCH 5/9] Docs/admin-guide/mm/damon/usage: document 'DEPRECATED' file of DAMON debugfs interface SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  2024-01-30  1:35 ` [PATCH 7/9] mm/damon/dbgfs: rename monitor_on file to monitor_on_DEPRECATED SeongJae Park
  2024-01-30  1:35 ` [PATCH 8/9] Docs/admin-guide/mm/damon/usage: update for monitor_on renaming SeongJae Park
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Shuah Khan, damon, linux-mm, linux-kselftest,
	linux-kernel

Following change will rename 'monitor_on' DAMON debugfs file to
'monitor_on_DEPRECATED', to make the deprecation unignorable in runtime.
Since it could make DAMON selftests fail and disturb future bisects,
update DAMON selftests to support the change.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 tools/testing/selftests/damon/_chk_dependency.sh     | 11 +++++++++--
 tools/testing/selftests/damon/_debugfs_common.sh     |  7 +++++++
 .../testing/selftests/damon/debugfs_empty_targets.sh | 12 ++++++++++--
 3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/damon/_chk_dependency.sh b/tools/testing/selftests/damon/_chk_dependency.sh
index 0328ac0b5a5e..350f8c2b071d 100644
--- a/tools/testing/selftests/damon/_chk_dependency.sh
+++ b/tools/testing/selftests/damon/_chk_dependency.sh
@@ -18,7 +18,14 @@ then
 	exit $ksft_skip
 fi
 
-for f in attrs target_ids monitor_on
+if [ -f "$DBGFS/monitor_on_DEPRECATED" ]
+then
+	monitor_on_file="monitor_on_DEPRECATED"
+else
+	monitor_on_file="monitor_on"
+fi
+
+for f in attrs target_ids "$monitor_on_file"
 do
 	if [ ! -f "$DBGFS/$f" ]
 	then
@@ -28,7 +35,7 @@ do
 done
 
 permission_error="Operation not permitted"
-for f in attrs target_ids monitor_on
+for f in attrs target_ids "$monitor_on_file"
 do
 	status=$( cat "$DBGFS/$f" 2>&1 )
 	if [ "${status#*$permission_error}" != "$status" ]; then
diff --git a/tools/testing/selftests/damon/_debugfs_common.sh b/tools/testing/selftests/damon/_debugfs_common.sh
index 48989d4813ae..aa995516870b 100644
--- a/tools/testing/selftests/damon/_debugfs_common.sh
+++ b/tools/testing/selftests/damon/_debugfs_common.sh
@@ -45,6 +45,13 @@ test_content() {
 source ./_chk_dependency.sh
 
 damon_onoff="$DBGFS/monitor_on"
+if [ -f "$DBGFS/monitor_on_DEPRECATED" ]
+then
+	damon_onoff="$DBGFS/monitor_on_DEPRECATED"
+else
+	damon_onoff="$DBGFS/monitor_on"
+fi
+
 if [ $(cat "$damon_onoff") = "on" ]
 then
 	echo "monitoring is on"
diff --git a/tools/testing/selftests/damon/debugfs_empty_targets.sh b/tools/testing/selftests/damon/debugfs_empty_targets.sh
index 87aff8083822..effbea33dc16 100755
--- a/tools/testing/selftests/damon/debugfs_empty_targets.sh
+++ b/tools/testing/selftests/damon/debugfs_empty_targets.sh
@@ -8,6 +8,14 @@ source _debugfs_common.sh
 
 orig_target_ids=$(cat "$DBGFS/target_ids")
 echo "" > "$DBGFS/target_ids"
-orig_monitor_on=$(cat "$DBGFS/monitor_on")
-test_write_fail "$DBGFS/monitor_on" "on" "orig_monitor_on" "empty target ids"
+
+if [ -f "$DBGFS/monitor_on_DEPRECATED" ]
+then
+	monitor_on_file="$DBGFS/monitor_on_DEPRECATED"
+else
+	monitor_on_file="$DBGFS/monitor_on"
+fi
+
+orig_monitor_on=$(cat "$monitor_on_file")
+test_write_fail "$monitor_on_file" "on" "orig_monitor_on" "empty target ids"
 echo "$orig_target_ids" > "$DBGFS/target_ids"
-- 
2.39.2



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

* [PATCH 7/9] mm/damon/dbgfs: rename monitor_on file to monitor_on_DEPRECATED
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
                   ` (5 preceding siblings ...)
  2024-01-30  1:35 ` [PATCH 6/9] selftets/damon: prepare for monitor_on file renaming SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  2024-01-30  1:35 ` [PATCH 8/9] Docs/admin-guide/mm/damon/usage: update for monitor_on renaming SeongJae Park
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, damon, linux-mm, linux-kernel

Kernel builders could silently enable CONFIG_DAMON_DBGFS_DEPRECATED.
Users who manually check the files under the DAMON debugfs directory
could notice the deprecation owing to the 'DEPRECATED' DAMON debugfs
file, but there could be users who doesn't manually check the files.

Make the deprecation cannot be ignored in the case by renaming
'monitor_on' file, which is essential for real use of DAMON on runtime,
to 'monitor_on_DEPRECATED'.  Still users who control DAMON via only
user-space tool could ignore the deprecation, but that's what the tool
developers should take care of.  DAMON user-space tool, damo, has also
made a change[1] for the purpose.

[1] commit 935dae76f2aee ("_damon_args: Rename --damon_interface to
    --damon_interface_DEPRECATED") of https://github.com/awslabs/damo

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/dbgfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index fbc0cd63f34c..f7abbc0633aa 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -1091,7 +1091,7 @@ static int __init __damon_dbgfs_init(void)
 {
 	struct dentry *dbgfs_root;
 	const char * const file_names[] = {"mk_contexts", "rm_contexts",
-		"monitor_on", "DEPRECATED"};
+		"monitor_on_DEPRECATED", "DEPRECATED"};
 	const struct file_operations *fops[] = {&mk_contexts_fops,
 		&rm_contexts_fops, &monitor_on_fops, &deprecated_fops};
 	int i;
-- 
2.39.2



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

* [PATCH 8/9] Docs/admin-guide/mm/damon/usage: update for monitor_on renaming
  2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
                   ` (6 preceding siblings ...)
  2024-01-30  1:35 ` [PATCH 7/9] mm/damon/dbgfs: rename monitor_on file to monitor_on_DEPRECATED SeongJae Park
@ 2024-01-30  1:35 ` SeongJae Park
  7 siblings, 0 replies; 9+ messages in thread
From: SeongJae Park @ 2024-01-30  1:35 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Jonathan Corbet, damon, linux-mm, linux-doc,
	linux-kernel

Update DAMON debugfs interface sections on the usage document to reflect
the fact that 'monitor_on' file has renamed to 'monitor_on_DEPRECATED'.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/admin-guide/mm/damon/usage.rst | 29 ++++++++++----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index 5d3df18dfb9f..58c34e66b31b 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -629,8 +629,9 @@ debugfs Interface (DEPRECATED!)
   linux-mm@kvack.org.
 
 DAMON exports nine files, ``DEPRECATED``, ``attrs``, ``target_ids``,
-``init_regions``, ``schemes``, ``monitor_on``, ``kdamond_pid``, ``mk_contexts``
-and ``rm_contexts`` under its debugfs directory, ``<debugfs>/damon/``.
+``init_regions``, ``schemes``, ``monitor_on_DEPRECATED``, ``kdamond_pid``,
+``mk_contexts`` and ``rm_contexts`` under its debugfs directory,
+``<debugfs>/damon/``.
 
 
 ``DEPRECATED`` is a read-only file for the DAMON debugfs interface deprecation
@@ -855,16 +856,16 @@ Turning On/Off
 
 Setting the files as described above doesn't incur effect unless you explicitly
 start the monitoring.  You can start, stop, and check the current status of the
-monitoring by writing to and reading from the ``monitor_on`` file.  Writing
-``on`` to the file starts the monitoring of the targets with the attributes.
-Writing ``off`` to the file stops those.  DAMON also stops if every target
-process is terminated.  Below example commands turn on, off, and check the
-status of DAMON::
+monitoring by writing to and reading from the ``monitor_on_DEPRECATED`` file.
+Writing ``on`` to the file starts the monitoring of the targets with the
+attributes.  Writing ``off`` to the file stops those.  DAMON also stops if
+every target process is terminated.  Below example commands turn on, off, and
+check the status of DAMON::
 
     # cd <debugfs>/damon
-    # echo on > monitor_on
-    # echo off > monitor_on
-    # cat monitor_on
+    # echo on > monitor_on_DEPRECATED
+    # echo off > monitor_on_DEPRECATED
+    # cat monitor_on_DEPRECATED
     off
 
 Please note that you cannot write to the above-mentioned debugfs files while
@@ -880,11 +881,11 @@ can get the pid of the thread by reading the ``kdamond_pid`` file.  When the
 monitoring is turned off, reading the file returns ``none``. ::
 
     # cd <debugfs>/damon
-    # cat monitor_on
+    # cat monitor_on_DEPRECATED
     off
     # cat kdamond_pid
     none
-    # echo on > monitor_on
+    # echo on > monitor_on_DEPRECATED
     # cat kdamond_pid
     18594
 
@@ -914,5 +915,5 @@ directory by putting the name of the context to the ``rm_contexts`` file. ::
     # ls foo
     # ls: cannot access 'foo': No such file or directory
 
-Note that ``mk_contexts``, ``rm_contexts``, and ``monitor_on`` files are in the
-root directory only.
+Note that ``mk_contexts``, ``rm_contexts``, and ``monitor_on_DEPRECATED`` files
+are in the root directory only.
-- 
2.39.2



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

end of thread, other threads:[~2024-01-30  1:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30  1:35 [PATCH 0/9] mm/damon: make DAMON debugfs interface deprecation unignorable SeongJae Park
2024-01-30  1:35 ` [PATCH 1/9] Docs/admin-guide/mm/damon/usage: use sysfs interface for tracepoints example SeongJae Park
2024-01-30  1:35 ` [PATCH 2/9] mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED SeongJae Park
2024-01-30  1:35 ` [PATCH 3/9] mm/damon/dbgfs: implement deprecation notice file SeongJae Park
2024-01-30  1:35 ` [PATCH 4/9] mm/damon/dbgfs: make debugfs interface deprecation message a macro SeongJae Park
2024-01-30  1:35 ` [PATCH 5/9] Docs/admin-guide/mm/damon/usage: document 'DEPRECATED' file of DAMON debugfs interface SeongJae Park
2024-01-30  1:35 ` [PATCH 6/9] selftets/damon: prepare for monitor_on file renaming SeongJae Park
2024-01-30  1:35 ` [PATCH 7/9] mm/damon/dbgfs: rename monitor_on file to monitor_on_DEPRECATED SeongJae Park
2024-01-30  1:35 ` [PATCH 8/9] Docs/admin-guide/mm/damon/usage: update for monitor_on renaming SeongJae Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).