From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Wolfgang Mauerer <wolfgang.mauerer@siemens.com>
Cc: "wm@linux-kernel.net" <wm@linux-kernel.net>,
"Kiszka, Jan" <jan.kiszka@siemens.com>,
"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] core-3.5 for x86
Date: Mon, 17 Dec 2012 20:12:08 +0100 [thread overview]
Message-ID: <50CF6E88.1010004@xenomai.org> (raw)
In-Reply-To: <50CF4392.4030000@siemens.com>
On 12/17/2012 05:08 PM, Wolfgang Mauerer wrote:
> On 15/12/12 23:16, Gilles Chanteperdrix wrote:
>> On 12/15/2012 11:03 PM, Wolfgang Mauerer wrote:
>>> On 15/12/2012 22:24, Gilles Chanteperdrix wrote:
>>>> I see some (recent) activity on this git repository:
>>>> https://github.com/siemens/ipipe/commits/core-3.5_for-upstream
>>>>
>>>> In what state is this branch, can I pull from it?
>>> please don't pull yet, I need to port a few more patches forward
>>> and fix one known issue with the tree. But I'll try to send a
>>> pull/discussion request next week.
>>>
>>>> At least the changes allowing preempt_disable()/preempt_enable() to be
>>>> called from non-root context look dubious.
>>> are you referring to 767f0d43fe3? This one still carries a TODO
>>> item in the description to remind me to check with which
>>> non-x86 archs this can cause problems, and what we can do about
>>> them.
>>
>>
>> Actually, we already have ipipe_safe_current(), so I guess what you need
>> is ipipe_safe_current_thread_info() ?
>
> yes, that makes sense -- how about something like
>
> #ifndef ipipe_safe_current_thread_info
> #define ipipe_safe_current_thread_info() \
> ({ \
> struct thread_info *__ti__; \
> unsigned long __flags__; \
> __flags__ = hard_smp_local_irq_save(); \
> __ti__ = ipipe_test_foreign_stack() ? \
> &init_thread_info : current_thread_info(); \
> hard_smp_local_irq_restore(__flags__); \
> __ti__; \
> })
> #endif
>
> and use that as basis to determine the preemption counter in preempt_count()?
> Unfortunately, solely #including linux/ipipe.h into linux/preempt.h
> leads to complete havoc, most likely caused by some spinlock preprocessor magic.
> So I need to figure out a clean way of getting this definition into preempt.h
> before I prepare a patch.
>
> Thanks, Wolfgang
>
Needless to say, you have to pay attention that add_preempt_count() and
sub_preempt_count() are no longer inlined in this case, otherwise this
will cause a lot of bloat. Also, you probably want safe_preempt_disable
and safe_preempt_enable which are nops for foreign stacks, and this
should be replaced unconditionnaly, but only for configurations
requiring it (such as CONFIG_PERF ?).
--
Gilles.
next prev parent reply other threads:[~2012-12-17 19:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <50CCEA7E.1080000__518.307140055363$1355606686$gmane$org@xenomai.org>
2012-12-15 22:03 ` [Xenomai] core-3.5 for x86 Wolfgang Mauerer
2012-12-15 22:07 ` Gilles Chanteperdrix
2012-12-15 22:16 ` Gilles Chanteperdrix
2012-12-17 16:08 ` Wolfgang Mauerer
2012-12-17 19:12 ` Gilles Chanteperdrix [this message]
2012-12-18 11:23 ` Jan Kiszka
2012-12-18 14:47 ` Gilles Chanteperdrix
2012-12-18 14:58 ` Wolfgang Mauerer
2012-12-19 21:06 ` Gilles Chanteperdrix
2012-12-20 16:22 ` Wolfgang Mauerer
2012-12-20 16:25 ` Gilles Chanteperdrix
2012-12-20 16:34 ` Wolfgang Mauerer
2012-12-21 0:28 ` Gilles Chanteperdrix
2012-12-21 9:08 ` Wolfgang Mauerer
2012-12-15 21:24 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=50CF6E88.1010004@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=jan.kiszka@siemens.com \
--cc=wm@linux-kernel.net \
--cc=wolfgang.mauerer@siemens.com \
--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.