mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
mm/damon: add CONFIG_DAMON_DEBUG_SANITY
Patch series "mm/damon: add optional debugging-purpose sanity checks". 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. Note that the verification only WARN_ON() for each of the insanity. The developer or tester may better to set panic_on_oops together, like damon-tests/corr did [2]. This patch (of 10): Add a new build config that will enable additional DAMON sanity checks. It is recommended to be enabled on only development and test setups, since it can impose additional overhead. Link: https://lkml.kernel.org/r/20260306152914.86303-1-sj@kernel.org Link: https://lkml.kernel.org/r/20260306152914.86303-2-sj@kernel.org Link: https://lore.kernel.org/20251231070029.79682-1-sj@kernel.org [1] Link: https://github.com/damonitor/damon-tests/commit/a80fbee55e272f151b4e5809ee85898aea33e6ff [2] Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Brendan Higgins <brendan.higgins@linux.dev> Cc: David Gow <davidgow@google.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
5a14198ec6
commit
62f0582875
@@ -12,6 +12,17 @@ config DAMON
|
||||
See https://www.kernel.org/doc/html/latest/mm/damon/index.html for
|
||||
more information.
|
||||
|
||||
config DAMON_DEBUG_SANITY
|
||||
bool "Check sanity of DAMON code"
|
||||
depends on DAMON
|
||||
help
|
||||
This enables additional DAMON debugging-purpose sanity checks in
|
||||
DAMON code. This can be useful for finding bugs, but impose
|
||||
additional overhead. This is therefore recommended to be enabled on
|
||||
only development and test setups.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config DAMON_KUNIT_TEST
|
||||
bool "Test for damon" if !KUNIT_ALL_TESTS
|
||||
depends on DAMON && KUNIT=y
|
||||
|
||||
Reference in New Issue
Block a user