On Fri, 02 Oct 2015 18:11:53 +0200, Gilles Chanteperdrix said:
TRACE_IRQFLAGS is broken with the I-pipe patch. At least on ARM. The visible result is LOCKDEP false positives, but there may be some more subtle kernel data structures corruption due to the fact that the TRACE_IRQFLAFGS code is called from the Xenomai context. The principle of Xenomai is to be able to run while Linux believes its interrupts are off, in the middle of its critical sections. For this to be possible, the code run in this context must never touch any Linux kernel data structures. Enabling TRACE_IRQFLAGS breaks this assumption: Linux code which potentially accesses Linux data structures gets called from the Xenomai context. The consequences can be anything, such as mlock failing, though in practice we never get any report about that. The usual reason for mlockall failing is because the user is not root, and with default ulimit settings at least, mlockall can not be called by non-root users.
Thanks for the detailed explanation - It's a refreshing change from the usual cargo-cult programming "It seems to break but we have no idea why, so just turn it off" we often see with out-of-tree patches. One thing jumped out at me:
The principle of Xenomai is to be able to run while Linux believes its interrupts are off, in the middle of its critical sections
Are you saying that it enables interrupts when Linux thinks they are off? If so, all I can say is: You're a far braver man than I. :)