linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 00/10] mm/damon: add optional debugging-purpose sanity checks
@ 2026-02-21 19:36 SeongJae Park
  2026-02-21 19:36 ` [RFC PATCH 01/10] mm/damon: add CONFIG_DAMON_DEBUG_SANITY SeongJae Park
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: SeongJae Park @ 2026-02-21 19:36 UTC (permalink / raw)
  Cc: SeongJae Park, Andrew Morton, Brendan Higgins, David Gow,
	Shuah Khan, damon, kunit-dev, linux-kernel, linux-kselftest,
	linux-mm

DAMON code has a few assumptions that can be critical if violated.
Validating the assumptions in code can be useful at finding such
critical bugs.  I was actually adding some such additional sanity checks
in my personal tree, and those were useful at finding bugs that I made
during the development of new patches.  We also found [1] sometimes the
assumptions are misunderstood.  The validation can work as good
documentation for such cases.

Add some of such debugging purpose sanity checks.  Because those
additional checks can impose more overhead, make those only optional via
new config, CONFIG_DAMON_DEBUG_SANITY, that is recommended for only
development and test setups.  And as recommended, enable it for DAMON
kunit tests and selftests.

[1] https://lore.kernel.org/20251231070029.79682-1-sj@kernel.org

SeongJae Park (10):
  mm/damon: add CONFIG_DAMON_DEBUG_SANITY
  mm/damon/core: add damon_new_region() debug_sanity check
  mm/damon/core: add damon_del_region() debug_sanity check
  mm/damon/core: add damon_nr_regions() debug_sanity check
  mm/damon/core: add damon_merge_two_regions() debug_sanity check
  mm/damon/core: add damon_merge_regions_of() debug_sanity check
  mm/damon/core: add damon_split_region_at() debug_sanity check
  mm/damon/core: add damon_reset_aggregated() debug_sanity check
  mm/damon/tests/.kunitconifg: enable DAMON_DEBUG_SANITY
  tools/testing/selftests/damon/config: enable DAMON_DEBUG_SANITY

 mm/damon/Kconfig                     |  11 +++
 mm/damon/core.c                      | 139 +++++++++++++++++++++++++++
 mm/damon/tests/.kunitconfig          |   3 +
 tools/testing/selftests/damon/config |   1 +
 4 files changed, 154 insertions(+)


base-commit: e059221c54896e36c8fc320029648e9013b382ea
-- 
2.47.3


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

end of thread, other threads:[~2026-02-21 20:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-21 19:36 [RFC PATCH 00/10] mm/damon: add optional debugging-purpose sanity checks SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 01/10] mm/damon: add CONFIG_DAMON_DEBUG_SANITY SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 02/10] mm/damon/core: add damon_new_region() debug_sanity check SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 03/10] mm/damon/core: add damon_del_region() " SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 04/10] mm/damon/core: add damon_nr_regions() " SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 05/10] mm/damon/core: add damon_merge_two_regions() " SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 06/10] mm/damon/core: add damon_merge_regions_of() " SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 07/10] mm/damon/core: add damon_split_region_at() " SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 08/10] mm/damon/core: add damon_reset_aggregated() " SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 09/10] mm/damon/tests/.kunitconifg: enable DAMON_DEBUG_SANITY SeongJae Park
2026-02-21 20:15   ` SeongJae Park
2026-02-21 19:36 ` [RFC PATCH 10/10] tools/testing/selftests/damon/config: " SeongJae Park

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