Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH 0/7] mm/damon: minor fixes and cleanups
@ 2022-09-09 20:28 SeongJae Park
  2022-09-09 20:28 ` [PATCH 1/7] selftest/damon: add a test for duplicate context dirs creation SeongJae Park
  0 siblings, 1 reply; 2+ messages in thread
From: SeongJae Park @ 2022-09-09 20:28 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Jonathan Corbet, Shuah Khan, Brendan Higgins,
	damon, linux-mm, linux-doc, linux-kselftest, linux-kernel

This patchset contains minor fixes and cleanups for DAMON including

- selftest for a bug we found before (Patch 1), 
- fix of region holes in vaddr corner case and a kunit test for it
  (Patches 2 and 3), and
- documents/Kconfig updates for title wordsmithing (Patch 4) and more
  aggressive DAMON debugfs interface deprecation announcement
  (Patches 5-7).

SeongJae Park (7):
  selftest/damon: add a test for duplicate context dirs creation
  mm/damon/core: avoid holes in newly set monitoring target ranges
  mm/damon/core-test: test damon_set_regions
  Docs/admin-guide/mm/damon: rename the title of the document
  mm/damon/Kconfig: Notify debugfs deprecation plan
  Docs/DAMON/start: mention the dependency as sysfs instead of debugfs
  Docs/admin-guide/mm/damon/usage: note DAMON debugfs interface
    deprecation plan

 Documentation/admin-guide/mm/damon/index.rst  |  6 ++---
 Documentation/admin-guide/mm/damon/start.rst  | 13 +++------
 Documentation/admin-guide/mm/damon/usage.rst  |  5 ++++
 mm/damon/Kconfig                              |  3 +++
 mm/damon/core-test.h                          | 23 ++++++++++++++++
 mm/damon/core.c                               | 24 +++++++++++++++++
 tools/testing/selftests/damon/Makefile        |  1 +
 .../debugfs_duplicate_context_creation.sh     | 27 +++++++++++++++++++
 8 files changed, 89 insertions(+), 13 deletions(-)
 create mode 100644 tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh

-- 
2.25.1


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

* [PATCH 1/7] selftest/damon: add a test for duplicate context dirs creation
  2022-09-09 20:28 [PATCH 0/7] mm/damon: minor fixes and cleanups SeongJae Park
@ 2022-09-09 20:28 ` SeongJae Park
  0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2022-09-09 20:28 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Shuah Khan, linux-kernel, damon, linux-mm, linux-kselftest,
	SeongJae Park

Commit d26f60703606 ("mm/damon/dbgfs: avoid duplicate context directory
creation") fixes a bug which could result in memory leak and DAMON
disablement.  This commit adds a selftest for verifying the fix and
avoid regression.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 tools/testing/selftests/damon/Makefile        |  1 +
 .../debugfs_duplicate_context_creation.sh     | 27 +++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh

diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile
index 0470c5f3e690..a1fa2eff8192 100644
--- a/tools/testing/selftests/damon/Makefile
+++ b/tools/testing/selftests/damon/Makefile
@@ -6,6 +6,7 @@ TEST_GEN_FILES += huge_count_read_write
 TEST_FILES = _chk_dependency.sh _debugfs_common.sh
 TEST_PROGS = debugfs_attrs.sh debugfs_schemes.sh debugfs_target_ids.sh
 TEST_PROGS += debugfs_empty_targets.sh debugfs_huge_count_read_write.sh
+TEST_PROGS += debugfs_duplicate_context_creation.sh
 TEST_PROGS += sysfs.sh
 
 include ../lib.mk
diff --git a/tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh b/tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh
new file mode 100644
index 000000000000..4a76e37ef16b
--- /dev/null
+++ b/tools/testing/selftests/damon/debugfs_duplicate_context_creation.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
+
+source _debugfs_common.sh
+
+# Test duplicated context creation
+# ================================
+
+if ! echo foo > "$DBGFS/mk_contexts"
+then
+	echo "context creation failed"
+	exit 1
+fi
+
+if echo foo > "$DBGFS/mk_contexts"
+then
+	echo "duplicate context creation success"
+	exit 1
+fi
+
+if ! echo foo > "$DBGFS/rm_contexts"
+then
+	echo "context deletion failed"
+	exit 1
+fi
+
+exit 0
-- 
2.25.1


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

end of thread, other threads:[~2022-09-09 20:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-09 20:28 [PATCH 0/7] mm/damon: minor fixes and cleanups SeongJae Park
2022-09-09 20:28 ` [PATCH 1/7] selftest/damon: add a test for duplicate context dirs creation SeongJae Park

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