From: Jan Kiszka <jan.kiszka@domain.hid>
To: rpm@xenomai.org
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH 3/2] kill XN_INFINITE xntimer delays
Date: Wed, 19 Jul 2006 13:07:23 +0200 [thread overview]
Message-ID: <44BE126B.4000209@domain.hid> (raw)
In-Reply-To: <1153305981.5036.33.camel@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 2108 bytes --]
Philippe Gerum wrote:
> On Wed, 2006-07-19 at 12:20 +0200, Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>> > [Appendix to the xntimer cleanup series.]
>> >
>> > Having to take care for infinite delays in xntimer_start (i.e. to NOT
>> > start the timer...) is a bit suboptimal given that his service might be
>> > used heavily to restart timers. This patch converts the only user
>> > (xnpod_start_timer again) and cleans up the timer code.
>> >
>> > Jan
>> > ---
>> > ksrc/nucleus/pod.c | 10 ++++++----
>> > ksrc/nucleus/timer.c | 34 ++++++++++++----------------------
>> > 2 files changed, 18 insertions(+), 26 deletions(-)
>> >
>> > Index: xenomai/ksrc/nucleus/pod.c
>> > ===================================================================
>> > --- xenomai.orig/ksrc/nucleus/pod.c
>> > +++ xenomai/ksrc/nucleus/pod.c
>> > @@ -3095,10 +3095,12 @@ int xnpod_start_timer(u_long nstick, xni
>> >
>> > xntimer_set_sched(&nkpod->htimer, xnpod_sched_slot(XNTIMER_KEEPER_ID));
>> >
>> > - xnlock_get_irqsave(&nklock, s);
>> > - xntimer_start(&nkpod->htimer, delta,
>> > - XNARCH_HOST_TICK / nkpod->tickvalue);
>> > - xnlock_put_irqrestore(&nklock, s);
>> > + if (delta) {
>>
>> Should not this rather be if (XNARCH_HOST_TICK) ?
>
> Both work, even if using the macro would get the unused code optimized
> away. The bottom line is that we need to refrain from starting the timer
Optimising away sounds good to me :). As we are already on it, I would
second Gilles' suggestion. It also makes the code more readable ("we do
not need the following when XNARCH_HOST_TICK is 0").
> whenever the delta value is zero, since it's a clear sign that
> XNARCH_HOST_TICK is zero in the first place. In all other cases, the
> delta value must be non-zero, even if the elapsed portion of the current
> tick is null.
>
>> > + xnlock_get_irqsave(&nklock, s);
>> > + xntimer_start(&nkpod->htimer, delta,
>> > + XNARCH_HOST_TICK / nkpod->tickvalue);
>> > + xnlock_put_irqrestore(&nklock, s);
>> > + }
>>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
prev parent reply other threads:[~2006-07-19 11:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-19 6:54 [Xenomai-core] [PATCH 3/2] kill XN_INFINITE xntimer delays Jan Kiszka
2006-07-19 10:20 ` Gilles Chanteperdrix
2006-07-19 10:46 ` Philippe Gerum
2006-07-19 11:07 ` Jan Kiszka [this message]
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=44BE126B.4000209@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=rpm@xenomai.org \
--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.