[LTP] [Patch V2] lib: multiply the max_runtime if detect kernel debug options

Petr Vorel pvorel@suse.cz
Mon Dec 9 05:43:18 CET 2024


Hi Li, Cyril,

> The method adjusts the max_runtime for test cases by multiplying
> it by a factor (4x) if any debug kernel options are detected.
> Debug kernel configurations (such as CONFIG_KASAN, CONFIG_PROVE_LOCKING, etc.)
> are known to degrade performance, and this adjustment ensures
> that tests do not fail prematurely due to timeouts.

> As Cyril pointed out that a debug kernel will typically run
> slower by a factor of N, and while determining the exact value
> of N is challenging, so a reasonable upper bound is sufficient
> for practical purposes.

> Signed-off-by: Li Wang <liwang@redhat.com>
> ---

> Notes:
>     Hi, @Cyril, @Petr, I have no openSUSE and Ubuntu at my hands, could you
>     help check if the debug configures are useful to the other two platforms?
>     Or, should we add any more options there? Thanks.

openSUSE debug kernel:

$ grep ^CONFIG_DEBUG /boot/config-6.13.0-rc1-1.g492f944-debug # openSUSE Tumbleweed
CONFIG_DEBUG_RSEQ=y
CONFIG_DEBUG_GPIO=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF5=y
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
CONFIG_DEBUG_NET=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_DEBUG_RODATA_TEST=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_SHIRQ=y
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y

=> openSUSE debug kernel would be detected by:
CONFIG_DEBUG_NET=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y

=> if you want to add more:
CONFIG_DEBUG_RSEQ=y
CONFIG_DEBUG_GPIO=y
CONFIG_DEBUG_RODATA_TEST=y
CONFIG_DEBUG_SHIRQ=y

Also FYI some options from default kernel (to see which cannot be used):

$ grep ^CONFIG_DEBUG /boot/config-6.13.0-rc1-1.g492f944-default # openSUSE
Tumbleweed
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF5=y
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y
CONFIG_DEBUG_FORCE_WEAK_PER_CPU=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_DEBUG_MEMORY_INIT=y

$ grep ^CONFIG_DEBUG /boot/config-6.11.10-amd64 # Debian
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_KERNEL=y
CONFIG_DEBUG_MISC=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
CONFIG_DEBUG_INFO_COMPRESSED_NONE=y
CONFIG_DEBUG_INFO_BTF=y
CONFIG_DEBUG_INFO_BTF_MODULES=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ALLOW_ALL=y
CONFIG_DEBUG_WX=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_DEBUG_LIST=y

Do Debian/Ubuntu even have debug kernel? I know only about linux-image-amd64-dbg
[1], but that package has just debugging symbols.

Which tests should I run on the kernel to see if timeout is ok?

Kind regards,
Petr

[1] https://packages.debian.org/sid/linux-image-amd64-dbg

...
> +/*
> + * List of debug-kernel config options that may degrade performance when enabled.
> + */
> +static const char * const tst_kconf_debug_options[][2] = {
> +	{"CONFIG_PROVE_LOCKING=y", NULL},
> +	{"CONFIG_LOCKDEP=y", NULL},
> +	{"CONFIG_DEBUG_SPINLOCK=y", NULL},
> +	{"CONFIG_DEBUG_RT_MUTEXES=y", NULL},
> +	{"CONFIG_DEBUG_MUTEXES=y", NULL},
> +	{"CONFIG_DEBUG_PAGEALLOC=y", NULL},
> +	{"CONFIG_KASAN=y", NULL},
> +	{"CONFIG_SLUB_RCU_DEBUG=y", NULL},
> +	{"CONFIG_TRACE_IRQFLAGS=y", NULL},
> +	{"CONFIG_LATENCYTOP=y", NULL},
> +	{"CONFIG_DEBUG_NET=y", NULL},
> +	{"CONFIG_EXT4_DEBUG=y", NULL},
> +	{"CONFIG_QUOTA_DEBUG=y", NULL},
> +	{"CONFIG_FAULT_INJECTION=y", NULL},
> +	{"CONFIG_DEBUG_OBJECTS=y", NULL},
> +	{NULL, NULL}
...


More information about the ltp mailing list