From: Hauke Mehrtens Date: Sat, 3 Mar 2018 14:08:05 +0000 (+0100) Subject: config: Add option for lockup and hung detection X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d95fc2399f73a6d11f6e5991c74822cb8314473e;p=openwrt%2Fstaging%2Fhauke.git config: Add option for lockup and hung detection These options allow it to build the kernel with soft lockup detection and with huge task detection. This could help to debug some problems in the kernel. Signed-off-by: Hauke Mehrtens --- diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 0cbe5e8351..21e5b98f3f 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -212,6 +212,37 @@ config KERNEL_PROVE_LOCKING select KERNEL_DEBUG_KERNEL default n +config KERNEL_LOCKUP_DETECTOR + bool + +config KERNEL_SOFTLOCKUP_DETECTOR + bool "Compile the kernel with Soft Lockup detection" + depends on KERNEL_DEBUG_KERNEL + select KERNEL_LOCKUP_DETECTOR + help + Say Y here to enable the kernel to act as a watchdog to detect + soft lockups. + + Softlockups are bugs that cause the kernel to loop in kernel + mode for more than 20 seconds, without giving other tasks a + chance to run. The current stack trace is displayed upon + detection and the system will stay locked up. + +config KERNEL_DETECT_HUNG_TASK + bool "Compile the kernel with Hung Tasks detection" + depends on KERNEL_DEBUG_KERNEL + default KERNEL_SOFTLOCKUP_DETECTOR + help + Say Y here to enable the kernel to detect "hung tasks", + which are bugs that cause the task to be stuck in + uninterruptible "D" state indefinitely. + + When a hung task is detected, the kernel will print the + current stack trace (which you should report), but the + task will stay in uninterruptible state. If lockdep is + enabled then all held locks will also be reported. This + feature has negligible overhead. + config KERNEL_PRINTK_TIME bool "Enable printk timestamps" default y diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18 index 04245531f6..cdba91f1bc 100644 --- a/target/linux/generic/config-3.18 +++ b/target/linux/generic/config-3.18 @@ -479,6 +479,8 @@ CONFIG_BLOCK=y # CONFIG_BONDING is not set # CONFIG_BOOKE_WDT is not set CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOT_PRINTK_DELAY is not set CONFIG_BOOT_RAW=y # CONFIG_BPCTL is not set @@ -860,6 +862,7 @@ CONFIG_DEBUG_KERNEL=y CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DEFAULT_IOSCHED="deadline" CONFIG_DEFAULT_MESSAGE_LOGLEVEL=4 CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index 48c7f31703..be2e29010d 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -588,6 +588,8 @@ CONFIG_BLOCK=y # CONFIG_BONDING is not set # CONFIG_BOOKE_WDT is not set CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOT_PRINTK_DELAY is not set CONFIG_BOOT_RAW=y CONFIG_BPF=y @@ -1069,6 +1071,7 @@ CONFIG_DEBUG_KERNEL=y CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DEFAULT_IOSCHED="deadline" CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_NOOP is not set diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4 index 3285000eb4..708122b420 100644 --- a/target/linux/generic/config-4.4 +++ b/target/linux/generic/config-4.4 @@ -489,6 +489,8 @@ CONFIG_BLOCK=y # CONFIG_BONDING is not set # CONFIG_BOOKE_WDT is not set CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOT_PRINTK_DELAY is not set CONFIG_BOOT_RAW=y CONFIG_BPF=y @@ -905,6 +907,7 @@ CONFIG_DEBUG_KERNEL=y CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DEFAULT_IOSCHED="deadline" CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_NOOP is not set diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 3f050c205c..5e866913b0 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -562,6 +562,8 @@ CONFIG_BLOCK=y # CONFIG_BONDING is not set # CONFIG_BOOKE_WDT is not set CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set # CONFIG_BOOT_PRINTK_DELAY is not set CONFIG_BOOT_RAW=y CONFIG_BPF=y @@ -692,8 +694,8 @@ CONFIG_CC_STACKPROTECTOR_NONE=y # CONFIG_CFG80211_CERTIFICATION_ONUS is not set # CONFIG_CGROUPS is not set # CONFIG_CGROUP_DEBUG is not set -# CONFIG_CGROUP_NET_PRIO is not set # CONFIG_CGROUP_NET_CLASSID is not set +# CONFIG_CGROUP_NET_PRIO is not set # CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_BQ24190 is not set # CONFIG_CHARGER_BQ24257 is not set @@ -1007,6 +1009,7 @@ CONFIG_DEBUG_KERNEL=y CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 CONFIG_DEFAULT_IOSCHED="deadline" CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_NOOP is not set