xenomomai-3 kernel freeze on RPI2
I've been watching for a while for a solution, or even conformation, of a potential kernel freeze problem on the Raspberry PI 2/3 platform with the Xenomai patches. Having not seen anything that appears related, I'm posting this description of what I've experienced.
I'm interesting in advice on how to solve this problem as well as how to best debug the issue. I've enabled 'Detect Hard and Soft Lockups' and 'Panic on Soft Lockups', but have not been successful in recovering from the hung state (other than by a power cycle) nor retrieving information related to the cause.
The details are below.
Thanks,
john
() Problem:
Under heavy load, a kernel compiled with the Xenomai patches ('CONFIG_XENOMAI=y' in .config) will freeze without warnings or error messages. The same kernel version compiled with xenomai patches off ('# CONFIG_XENOMAI is not set' in .config) does not experience such problems.
() Hardware:
Tested on several Raspberry 2 and 3 boards with various sdcards and power supplies. Using the default system boot configuration and system clock (i.e. not overclocked).
() Software:
kernel 4.1.21 from https://github.com/raspberrypi/linux/tree/rpi-4.1.y
Mathieu Rondonneau RPI2 patch from this list, Apr 16 2016
ipipe-core-4.1.18-arm-8.patch
xenomai-3-3.0.3
note: I have tested, with similar results, many other kernels and as far back as kernel 3.18 & xenomai-3-3.0.1
() Conditions to reproduce kernel freeze:
Boot xenomai patched kernel
Launch a kernel build process and unzip process. I commonly do this through 'screen' as follows:
(I'm leaving out obvious setup steps such as 'mkdir <foobar>', 'make defconfig', etc) []# screen
[]# cd linux-rpi-3.18.y/
[]# for i in seq 1 5; do make -j4 bzImage; make clean; done
[]# <ctl-a> c (new screen & shell)
[]# cd tmp
[]# for i in seq 1 30; do unzip ../linux-rpi-3.18.y.zip; rm -rf linux-rpi-3.18.y; done []# <ctl-a> c (new screen & shell)
[]# top
With the 'CONFIG_XENOMAI=y' kernel, this will typically create a kernel freeze in 3 to 20 minutes.
Note that this load does not seem to be enough to use swap space and I have not launched any Xemonai threads.
() Comments
I have tested this level of load for 18+ hours using the same kernel compiled with '# CONFIG_XENOMAI is not set' in the configuration file. There is no failure in this case.
The basic .config file differences are shown below. I can make available the actual configuration files if needed.
< '# CONFIG_XENOMAI is not set' .config file
Quoted 1 line
'#
CONFIG_XENOMAI=y' .config file
< CONFIG_PREEMPT_RCU=y
Quoted 2 lines
CONFIG_TREE_RCU=yCONFIG_OPTPROBES=y
< CONFIG_HAVE_CONTEXT_TRACKING=y
< CONFIG_UNINLINE_SPIN_UNLOCK=y
Quoted 35 lines
CONFIG_INLINE_SPIN_UNLOCK_IRQ=yCONFIG_INLINE_READ_UNLOCK=yCONFIG_INLINE_READ_UNLOCK_IRQ=yCONFIG_INLINE_WRITE_UNLOCK=yCONFIG_INLINE_WRITE_UNLOCK_IRQ=yCONFIG_XENOMAI=yCONFIG_XENO_OPT_STATS=yCONFIG_XENO_OPT_RR_QUANTUM=1000CONFIG_XENO_OPT_AUTOTUNE=yCONFIG_XENO_OPT_TIMER_LIST=yCONFIG_XENO_OPT_HOSTRT=yCONFIG_XENO_OPT_VFILE=yCONFIG_XENO_OPT_REGISTRY_NRSLOTS=512CONFIG_XENO_OPT_SYS_HEAPSZ=1024CONFIG_XENO_OPT_PRIVATE_HEAPSZ=128CONFIG_XENO_OPT_SHARED_HEAPSZ=128CONFIG_XENO_OPT_NRTIMERS=128CONFIG_XENO_OPT_TIMING_SCHEDLAT=0CONFIG_XENO_OPT_TIMING_KSCHEDLAT=0CONFIG_XENO_OPT_TIMING_IRQLAT=0CONFIG_XENO_OPT_RTDM_COMPAT_DEVNODE=yCONFIG_XENO_DRIVERS_AUTOTUNE=yCONFIG_XENO_DRIVERS_TIMERBENCH=yCONFIG_XENO_DRIVERS_SWITCHTEST=yCONFIG_XENO_ARCH_UNLOCKED_SWITCH=yCONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH=yCONFIG_IPIPE_WANT_ACTIVE_MM=yCONFIG_XENO_ARCH_WANT_TIP=yCONFIG_XENO_ARCH_FPU=yCONFIG_XENO_ARCH_OUTOFLINE_XNLOCK=yCONFIG_XENO_VERSION_MAJOR=3CONFIG_XENO_VERSION_MINOR=0CONFIG_XENO_REVISION_LEVEL=3CONFIG_XENO_VERSION_STRING="3.0.3"CONFIG_XENO_VERSION_NAME="GroovyCosmic Halo"
Quoted 8 lines
CONFIG_IPIPE_ARM_KUSER_TSC=yCONFIG_NEED_KUSER_HELPERS=yCONFIG_IPIPE=yCONFIG_IPIPE_CORE=yCONFIG_IPIPE_CORE_APIREV=2CONFIG_IPIPE_WANT_APIREV_2=yCONFIG_IPIPE_TARGET_APIREV=2CONFIG_IPIPE_HAVE_HOSTRT=y
< CONFIG_PREEMPT=y
< CONFIG_PREEMPT_COUNT=y
Quoted 1 line
CONFIG_PREEMPT_VOLUNTARY=y
< CONFIG_SECCOMP=y
Quoted 11 lines
CONFIG_IPV6_SUBTREES=yCONFIG_BT_HCIUART=mCONFIG_BT_HCIUART_H4=yCONFIG_BT_HCIUART_3WIRE=yCONFIG_BT_HCIUART_BCM=yCONFIG_QCA7000=mCONFIG_GPIO_BCM_VIRT=yCONFIG_DRM=mCONFIG_DRM_KMS_HELPER=mCONFIG_DRM_KMS_FB_HELPER=yCONFIG_DRM_GEM_CMA_HELPER=y
Quoted 8 lines
CONFIG_DRM_KMS_CMA_HELPER=yCONFIG_DRM_VC4=mCONFIG_HDMI=yCONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=yCONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=mCONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=mCONFIG_HID_BETOP_FF=mCONFIG_MCP3422=m
< CONFIG_DEBUG_PREEMPT=y
< CONFIG_DYNAMIC_FTRACE=y
< CONFIG_FTRACE_MCOUNT_RECORD=y
Am Wed, 1 Feb 2017 13:42:07 -0500
schrieb John Gwynne <[email protected]>:
Quoted 10 lines
I've been watching for a while for a solution, or even conformation, of a potential kernel freeze problem on the Raspberry PI 2/3 platform with the Xenomai patches. Having not seen anything that appears related, I'm posting this description of what I've experienced.
I'm interesting in advice on how to solve this problem as well as how to best debug the issue. I've enabled 'Detect Hard and Soft Lockups' and 'Panic on Soft Lockups', but have not been successful in recovering from the hung state (other than by a power cycle) nor retrieving information related to the cause.
Did you capture the console output via serial? That might give a clue especially with increased loglevels and maybe additional printks on the "new" or "suspicous" paths.
Your tests look like they put stress on the SD-card and CPU. Maybe try stressing just the SD-card interrupt-path. (i.e. multiple dd to /dev/null) Or just the CPU, or another interrupt.
Further debugging techniques would be JTAG and tracing to nvram. They depend on your hardware and i am not sure they can be used on the Raspberry Pi.
regards,
Henning
Quoted 140 lines
The details are below.
Thanks,
john() Problem:
Under heavy load, a kernel compiled with the Xenomai patches ('CONFIG_XENOMAI=y' in .config) will freeze without warnings or error messages. The same kernel version compiled with xenomai patches off ('#CONFIG_XENOMAIis not set' in .config) does not experience such problems.() Hardware:
Tested on several Raspberry 2 and 3 boards with various sdcards and power supplies. Using the default system boot configuration and system clock (i.e. not overclocked).() Software:
kernel 4.1.21 from https://github.com/raspberrypi/linux/tree/rpi-4.1.y
Mathieu Rondonneau RPI2 patch from this list, Apr 16 2016 ipipe-core-4.1.18-arm-8.patch
xenomai-3-3.0.3
note: I have tested, with similar results, many other kernels and as far back as kernel 3.18 & xenomai-3-3.0.1() Conditions to reproduce kernel freeze:
Boot xenomai patched kernel
Launch a kernel build process and unzip process. I commonly do this through 'screen' as follows:
(I'm leaving out obvious setup steps such as 'mkdir <foobar>', 'make defconfig', etc)
[]# screen
[]# cd linux-rpi-3.18.y/
[]# for i inseq 1 5; do make -j4 bzImage; make clean; done []# <ctl-a> c (new screen & shell)
[]# cd tmp
[]# for i inseq 1 30; do unzip ../linux-rpi-3.18.y.zip; rm -rf linux-rpi-3.18.y; done
[]# <ctl-a> c (new screen & shell)
[]# topWith the '
CONFIG_XENOMAI=y' kernel, this will typically create a kernel freeze in 3 to 20 minutes.Note that this load does not seem to be enough to use swap space and I have not launched any Xemonai threads.
() Comments
I have tested this level of load for 18+ hours using the same kernel compiled with '#CONFIG_XENOMAIis not set' in the configuration file. There is no failure in this case.The basic .config file differences are shown below. I can make available the actual configuration files if needed.
< '#
CONFIG_XENOMAIis not set' .config fileQuoted 1 line
'#
CONFIG_XENOMAI=y' .config file<
CONFIG_PREEMPT_RCU=yQuoted 2 lines
CONFIG_TREE_RCU=yCONFIG_OPTPROBES=y<
CONFIG_HAVE_CONTEXT_TRACKING=y
<CONFIG_UNINLINE_SPIN_UNLOCK=yQuoted 35 lines
CONFIG_INLINE_SPIN_UNLOCK_IRQ=yCONFIG_INLINE_READ_UNLOCK=yCONFIG_INLINE_READ_UNLOCK_IRQ=yCONFIG_INLINE_WRITE_UNLOCK=yCONFIG_INLINE_WRITE_UNLOCK_IRQ=yCONFIG_XENOMAI=yCONFIG_XENO_OPT_STATS=yCONFIG_XENO_OPT_RR_QUANTUM=1000CONFIG_XENO_OPT_AUTOTUNE=yCONFIG_XENO_OPT_TIMER_LIST=yCONFIG_XENO_OPT_HOSTRT=yCONFIG_XENO_OPT_VFILE=yCONFIG_XENO_OPT_REGISTRY_NRSLOTS=512CONFIG_XENO_OPT_SYS_HEAPSZ=1024CONFIG_XENO_OPT_PRIVATE_HEAPSZ=128CONFIG_XENO_OPT_SHARED_HEAPSZ=128CONFIG_XENO_OPT_NRTIMERS=128CONFIG_XENO_OPT_TIMING_SCHEDLAT=0CONFIG_XENO_OPT_TIMING_KSCHEDLAT=0CONFIG_XENO_OPT_TIMING_IRQLAT=0CONFIG_XENO_OPT_RTDM_COMPAT_DEVNODE=yCONFIG_XENO_DRIVERS_AUTOTUNE=yCONFIG_XENO_DRIVERS_TIMERBENCH=yCONFIG_XENO_DRIVERS_SWITCHTEST=yCONFIG_XENO_ARCH_UNLOCKED_SWITCH=yCONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH=yCONFIG_IPIPE_WANT_ACTIVE_MM=yCONFIG_XENO_ARCH_WANT_TIP=yCONFIG_XENO_ARCH_FPU=yCONFIG_XENO_ARCH_OUTOFLINE_XNLOCK=yCONFIG_XENO_VERSION_MAJOR=3CONFIG_XENO_VERSION_MINOR=0CONFIG_XENO_REVISION_LEVEL=3CONFIG_XENO_VERSION_STRING="3.0.3"CONFIG_XENO_VERSION_NAME="GroovyCosmic Halo"Quoted 8 lines
CONFIG_IPIPE_ARM_KUSER_TSC=yCONFIG_NEED_KUSER_HELPERS=yCONFIG_IPIPE=yCONFIG_IPIPE_CORE=yCONFIG_IPIPE_CORE_APIREV=2CONFIG_IPIPE_WANT_APIREV_2=yCONFIG_IPIPE_TARGET_APIREV=2CONFIG_IPIPE_HAVE_HOSTRT=y<
CONFIG_PREEMPT=y
<CONFIG_PREEMPT_COUNT=yQuoted 1 line
CONFIG_PREEMPT_VOLUNTARY=y<
CONFIG_SECCOMP=yQuoted 11 lines
CONFIG_IPV6_SUBTREES=yCONFIG_BT_HCIUART=mCONFIG_BT_HCIUART_H4=yCONFIG_BT_HCIUART_3WIRE=yCONFIG_BT_HCIUART_BCM=yCONFIG_QCA7000=mCONFIG_GPIO_BCM_VIRT=yCONFIG_DRM=mCONFIG_DRM_KMS_HELPER=mCONFIG_DRM_KMS_FB_HELPER=yCONFIG_DRM_GEM_CMA_HELPER=yQuoted 8 lines
CONFIG_DRM_KMS_CMA_HELPER=yCONFIG_DRM_VC4=mCONFIG_HDMI=yCONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=yCONFIG_SND_BCM2708_SOC_BOOMBERRY_DAC=mCONFIG_SND_BCM2708_SOC_BOOMBERRY_DIGI=mCONFIG_HID_BETOP_FF=mCONFIG_MCP3422=m<
CONFIG_DEBUG_PREEMPT=y
<CONFIG_DYNAMIC_FTRACE=y
<CONFIG_FTRACE_MCOUNT_RECORD=y_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai
Quoted 5 lines · John Gwynne
I've been watching for a while for a solution, or even conformation, of a potential kernel freeze problem on the Raspberry PI 2/3 platform with the Xenomai patches. Having not seen anything that appears related, I'm posting this description of what I've experienced.
Maybe you could try this port. I have only tested the BCM2835 implementation so far, but the pipeline code for supporting the BCM2836 is there too. I have no idea whether it boots though:
http://git.xenomai.org/ipipe.git/log/?h=vendors/raspberry/ipipe-4.1
Signature · 1 line
Philippe.