kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: gilles.chanteperdrix@xenomai.org (Gilles Chanteperdrix)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Unset LOCKDEP and TRACE_IRQFLAGS_SUPPORT
Date: Sat, 3 Oct 2015 08:47:51 +0200	[thread overview]
Message-ID: <20151003064751.GW31137@hermes.click-hack.org> (raw)
In-Reply-To: <195331.1443822232@turing-police.cc.vt.edu>

On Fri, Oct 02, 2015 at 05:43:52PM -0400, Valdis.Kletnieks at vt.edu wrote:
> 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.

Well, it also depends on what the option is, projects with small
numbers of contributors do not necessarily have the time to
investigate breakages introduced by some obscure options. lockdep is
not "some obscure option", people want to be able to enable it.

> 
> 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?

Yes, but of course if an interrupt happens for Linux during that time,
it is logged, then played back when Linux unmasks interrupts. It is
a very old principle:
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.44.8347

The advantage of doing that is that if an interrupt happens for the
real time system, it can be handled without waiting for Linux to
unmask interrupts.

> 
> If so, all I can say is: You're a far braver man than I. :)

The alternate solution is the native preemption, implemented by the
preempt_rt patch. But we do not know yet which of the two solutions
is crazier. It seems both have strengths and weaknesses. The next
version of Xenomai, about to be released, lets the user choose his
side.

-- 
					    Gilles.
https://click-hack.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20151003/427f2cfe/attachment.bin 

  reply	other threads:[~2015-10-03  6:47 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-26 14:16 Unset LOCKDEP and TRACE_IRQFLAGS_SUPPORT vibnwis
2015-09-26 16:03 ` Valdis.Kletnieks at vt.edu
2015-09-26 23:06   ` vibnwis
2015-09-27  0:54     ` Valdis.Kletnieks at vt.edu
2015-09-27  1:09       ` vibnwis
2015-09-27  1:53         ` Valdis.Kletnieks at vt.edu
2015-09-27  2:08           ` vibnwis
2015-09-27  6:00             ` vibnwis
2015-09-27 14:56               ` Valdis.Kletnieks at vt.edu
2015-09-27 14:52             ` Valdis.Kletnieks at vt.edu
2015-09-27 20:58               ` vibnwis
2015-09-27 22:22                 ` Valdis.Kletnieks at vt.edu
2015-09-27 22:42                   ` vibnwis
2015-09-28  0:17                     ` Valdis.Kletnieks at vt.edu
2015-10-02 15:56               ` Jim Cromie
2015-10-02 16:11                 ` Gilles Chanteperdrix
2015-10-02 21:43                   ` Valdis.Kletnieks at vt.edu
2015-10-03  6:47                     ` Gilles Chanteperdrix [this message]
2015-10-03 12:33                   ` vibnwis
2015-10-03 13:11                     ` Gilles Chanteperdrix
2015-10-05  1:24                       ` vibnwis
2015-10-05  6:07                         ` Gilles Chanteperdrix
2015-10-05  7:56                           ` vibnwis
2015-10-05  7:07                         ` Gilles Chanteperdrix
2015-10-05  7:54                           ` vibnwis
2015-10-05  8:19                             ` Gilles Chanteperdrix
2015-10-03 13:13                     ` Gilles Chanteperdrix
2015-10-02 17:09                 ` Gilles Chanteperdrix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151003064751.GW31137@hermes.click-hack.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).