All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Stephan Kappertz <stephan.kappertz@kabelmail.de>,
	Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] Raspberry and Beaglebone patches
Date: Tue, 14 May 2013 13:26:48 +0200	[thread overview]
Message-ID: <51921F78.60504@xenomai.org> (raw)
In-Reply-To: <51921BFC.9020404@siemens.com>

On 05/14/2013 01:11 PM, Jan Kiszka wrote:

> On 2013-05-14 13:02, Gilles Chanteperdrix wrote:
>>> OK, I pushed the patch for upstream merge. It's probably better to carry
>>> the workaround than letting users find out the reason the hard way.
>>> Gilles, please consider it for 2.6.3.
>>
>>
>> Ok, but does not the workaround of un-inlining xeno_bind_skin make more
>> sense?
> 
> The issue is not with xeno_bind_skin and its inlining but with patterns like
> 
> my_function()
> {
> 	if (condition)
> 		return;
> 	do_other_stuff();
> }
> 
> gcc tends to push do_other_stuff into a sub-function called
> my_function.part.0, and that part is then incorrectly registered as
> constructor function as well.


I understood that, but in the case of the native skin, the only such
branch is created by the fact that xeno_bind_skin is inlined (and it is
the other way around, it is the if branch that goes in a helper
function, the unlikely branch in fact). So, if the native skin
initialization is the only one to be problematic, then it fixes the
issue. If the native skin initialization is not the only one to be
problematic, then your patch is unsufficient. It is also unsufficient
because it does not guarantee that the compiler will not inline
__init_xeno_interface in __init_wrapper when we use other more
aggressive compilation options, at minimum __attribute__((noinline))
would be needed, and not only for the native skin. So, I nack this patch.

So, since we know that this is a broken compiler and that there are
other versions that work, I propose to detect it in the configure script
and abort compilation when we find this compiler.

Yet another solution would be to suppress the automatic binding with
__attribute__((constructor)) and bind the skin on first use of the
"muxid", with a static inline function using a static pthread_once_t.

-- 
                                                                Gilles.


  reply	other threads:[~2013-05-14 11:26 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-15  6:57 [Xenomai] Raspberry and Beaglebone patches Gilles Chanteperdrix
2013-04-15 10:52 ` Paul
2013-04-15 19:46   ` Gilles Chanteperdrix
2013-04-20 23:44     ` Paul
2013-04-21  0:01       ` Jason Kridner
2013-04-16 10:26 ` Stephan Kappertz
2013-04-16 18:06   ` Gilles Chanteperdrix
     [not found]     ` <F484004F-9908-449C-A4DA-CB73E47EE764@kabelmail.de>
     [not found]       ` <5182B1B5.1000107@xenomai.org>
2013-05-03 14:28         ` Stephan Kappertz
2013-05-03 18:19           ` Gilles Chanteperdrix
2013-05-03 20:41             ` Stephan Kappertz
2013-05-08 18:27               ` Gilles Chanteperdrix
2013-05-10 11:53                 ` Stephan Kappertz
2013-05-10 13:21                   ` Gilles Chanteperdrix
2013-05-10 14:43                     ` Stephan Kappertz
2013-05-10 14:44                       ` Gilles Chanteperdrix
2013-05-10 16:40                         ` Stephan Kappertz
2013-05-10 16:48                           ` Gilles Chanteperdrix
2013-05-10 17:02                             ` Gilles Chanteperdrix
2013-05-13 10:37                               ` Stephan Kappertz
2013-05-13 11:20                                 ` Stephan Kappertz
2013-05-14  6:41                                   ` Gilles Chanteperdrix
2013-05-14  6:50                                     ` Gilles Chanteperdrix
2013-05-14  7:33                                     ` Stephan Kappertz
2013-05-14  7:53                                       ` Gilles Chanteperdrix
2013-05-14  9:11                                         ` Stephan Kappertz
2013-05-14  9:20                                           ` Jan Kiszka
2013-05-14  9:44                                             ` Stephan Kappertz
2013-05-14 10:35                                               ` Jan Kiszka
2013-05-14 11:02                                                 ` Gilles Chanteperdrix
2013-05-14 11:11                                                   ` Jan Kiszka
2013-05-14 11:26                                                     ` Gilles Chanteperdrix [this message]
2013-05-14 11:53                                                       ` Jan Kiszka
2013-05-14 11:19                                                   ` Stephan Kappertz
2013-05-14 11:26                                                     ` Jan Kiszka
2013-05-14 18:30                                               ` Gilles Chanteperdrix
2013-05-15  7:34                                                 ` Stephan Kappertz
2013-05-14  8:06                                     ` Stephan Kappertz
2013-05-13 11:22                                 ` Gilles Chanteperdrix
2013-05-13 11:52                                 ` Gilles Chanteperdrix
2013-05-13 22:49                                   ` Gilles Chanteperdrix
2013-05-18 15:04                   ` 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=51921F78.60504@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=jan.kiszka@siemens.com \
    --cc=stephan.kappertz@kabelmail.de \
    --cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.