From: Philippe Gerum <rpm@xenomai.org>
To: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Cc: Adeos <adeos-main@gna.org>
Subject: Re: [Adeos-main] Reworking ipipe timer subsystem,
Date: Fri, 24 Feb 2012 15:40:33 +0100 [thread overview]
Message-ID: <4F47A161.9010704@domain.hid> (raw)
In-Reply-To: <4F478285.8020105@domain.hid>
On 02/24/2012 01:28 PM, Gilles Chanteperdrix wrote:
> On 02/20/2012 05:46 PM, Philippe Gerum wrote:
>> On 02/19/2012 08:43 PM, Gilles Chanteperdrix wrote:
>>>
>>> Hi,
>>>
>>> restarting the ipipe-core is the good opportunity to look a bit at our
>>> current state and think about what we could improve. On ARM, at least,
>>> the thing we could improve is the timer subsystem. A long time ago,
>>> linux has switched to a system allowing to select at run-time which
>>> timer to use, and we do not really benefit from this, what timer we use
>>> is selected at compile time, resulting in a massive ifdefery on arm, and
>>> even on x86, we have to select at compile time whether using the 8254 or
>>> APIC, whereas we could decide to use whatever linux is using, even say
>>> HPET, without any compilation option. That is assuming we want to move
>>> the x86 timer-specific code from xenomai to I-pipe.
>>>
>>> The idea to reach this goal would be to add some ipipe specific members
>>> to the struct clock_event_device, the way we do for the interrupt
>>> controller:
>>> - a CLOCK_EVT_FEAT_IPIPE would signal that the clockevent device is
>>> ipipe capable, meaning that it implements the following callback
>>> - ipipe_steal would be called when stealing the timer, we could decide
>>> to call this callback either as part of ipipe_request_timer, or with a
>>> specific ipipe_steal_timer call, currently we simply set
>>> __ipipe_mach_timerstolen to 1, but it is pure luck that we never needed
>>> something more complicated, besides, we may want to start a timer that
>>> was not started by linux so, we would put its initialization here;
>>> - ipipe_stolen would record whether the timer is stolen
>>> - ipipe_min_delta_ticks, ipipe_max_delta_ticks would be used by the
>>> ipipe_set_next_event callback
>>> - ipipe_ack would be called to ack the timer interrupt the way we
>>> currently do it currently on arm with __ipipe_mach_acktimer
>>> - ipipe_set_next_event would program the next timer shot, the way it is
>>> currently done in __ipipe_mach_set_dec.
>>>
>>> All this is pretty straightforward, but there is still a question: how
>>> does ipipe_request_timer select a timer. The idea is that on platform
>>> without PIC muting, it is probably more efficient to use the same timer
>>> for linux and xenomai. But on platforms with PIC muting, we could want
>>> to select a different timer for linux and xenomai, but how do we find
>>> it, what if linux has not selected a timer because it is unusable on
>>> that platform?
>>
>> Checking the clock device mode for CLOCK_EVT_MODE_SHUTDOWN, and falling
>> back to sharing the active kernel tick device + disabling PIC muting?
>
> OK. Another question is: do we want to move x86 timer handling from
> xenomai to ipipe. If not, we have to find a way to support the two
> possible configurations. What we could do is using the timer name in
> ipipe_request_tickdev: if a timer name is supplied, we keep the old
> implementation, if no timer name is supplied, we use the new
> implementation which looks for the best candidate with the
> CLOCK_EVT_FEAT_IPIPE bit.
>
>
Yes, makes sense. At any rate, handling the real-time timer the way we
want for Xenomai directly from the pipeline is the only sane option. We
only have to be careful about backward compatibility of the newest core
pipelines with 2.6.x, until we stop maintaining this branch in favor of
3.x. We may also move ipipe_request_tckdev() to the compat module fully,
removing it from the current API if that makes sense.
--
Philippe.
next prev parent reply other threads:[~2012-02-24 14:40 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-19 19:43 [Adeos-main] Reworking ipipe timer subsystem, Gilles Chanteperdrix
2012-02-20 16:46 ` Philippe Gerum
2012-02-24 12:28 ` Gilles Chanteperdrix
2012-02-24 14:40 ` Philippe Gerum [this message]
2012-04-02 15:39 ` Gilles Chanteperdrix
2012-04-02 15:54 ` Jan Kiszka
2012-04-02 16:08 ` Gilles Chanteperdrix
2012-04-02 16:18 ` Jan Kiszka
2012-04-02 16:21 ` Gilles Chanteperdrix
2012-04-02 20:41 ` Gilles Chanteperdrix
2012-04-02 20:56 ` Jan Kiszka
2012-04-02 20:59 ` Jan Kiszka
2012-04-02 21:55 ` Gilles Chanteperdrix
2012-04-02 21:58 ` Jan Kiszka
2012-04-03 7:54 ` Gilles Chanteperdrix
2012-04-03 7:59 ` Jan Kiszka
2012-04-03 11:06 ` Gilles Chanteperdrix
2012-04-03 17:38 ` Jan Kiszka
2012-04-03 18:17 ` Gilles Chanteperdrix
2012-04-03 18:26 ` Jan Kiszka
2012-04-03 18:34 ` Gilles Chanteperdrix
2012-04-03 18:39 ` Jan Kiszka
2012-04-03 19:05 ` 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=4F47A161.9010704@domain.hid \
--to=rpm@xenomai.org \
--cc=adeos-main@gna.org \
--cc=gilles.chanteperdrix@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.