From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: [Xenomai-core] [RFC] Fix excessive host tick latencies
Date: Fri, 30 Apr 2010 15:33:07 +0200 [thread overview]
Message-ID: <4BDADC13.2070500@domain.hid> (raw)
Hi Philippe,
I'm not 100% sure if this plugs all remaining wholes in the deferred
host tick processing, but at least the most easiest reproducible one is
cured now for me (Linux latency peak after termination of 'latency').
Please let me know if you see more potential issues, otherwise I would
include this in my for-upstream queue.
Found while instrumenting the timer core to find RT timer latencies.
Hope they become visible now...
Jan
-------
If a reschedule is pending, we won't allow the host timer to decide
about the next hardware tick. But if that next reschedule will simply
keep ROOT (which, e.g., happens during thread deletion), this deferral
can impose significant unwanted timer latencies on Linux.
diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index 3ffd548..fb63f35 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -2184,9 +2184,16 @@ void __xnpod_schedule(struct xnsched *sched)
zombie = xnthread_test_state(curr, XNZOMBIE);
next = xnsched_pick_next(sched);
- if (next == curr && !xnthread_test_state(curr, XNRESTART))
+ if (next == curr && !xnthread_test_state(curr, XNRESTART)) {
/* Note: the root thread never restarts. */
+ if (unlikely(xnthread_test_state(next, XNROOT))) {
+ if (testbits(sched->status, XNHTICK))
+ xnintr_host_tick(sched);
+ if (testbits(sched->status, XNHDEFER))
+ xntimer_next_local_shot(sched);
+ }
goto signal_unlock_and_exit;
+ }
XENO_BUGON(NUCLEUS, need_resched == 0);
next reply other threads:[~2010-04-30 13:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-30 13:33 Jan Kiszka [this message]
2010-04-30 14:29 ` [Xenomai-core] [RFC] Fix excessive host tick latencies Gilles Chanteperdrix
2010-04-30 14:34 ` Jan Kiszka
2010-04-30 20:13 ` Philippe Gerum
2010-04-30 21:01 ` Gilles Chanteperdrix
2010-05-01 8:24 ` Philippe Gerum
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=4BDADC13.2070500@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.