From: Philippe Gerum <rpm@xenomai.org>
To: Steven Seeger <steven.seeger@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-core] irq0 usage
Date: Tue, 24 Mar 2009 00:18:58 +0100 [thread overview]
Message-ID: <1237850338.13946.117.camel@domain.hid> (raw)
In-Reply-To: <08A82EA4-797A-42C9-AE47-1A260D58E4DB@comcast.net>
On Mon, 2009-03-23 at 19:03 -0400, Steven Seeger wrote:
> > What are you comparing, I mean, exactly?
> > All kernel RTAI vs all userland Xenomai?
>
> Yes.
>
Ok, so we will agree that the 20%/60% ratios can't be compared, in fact.
> >
> >
> > The timer handler is charged for the callbacks it runs, so it really
> > boils down to what code is attached to Xenomai timers, aside of the
> > built-in scheduler tick.
>
> In this case we have only a single RTDM timer that fires ever 125 us
> and does nothing (as a test.) It will be easy to remove this and
> compare the amount of usage irq0 handler uses without it. I know it'll
> be at least 14 or 15.
Let's check this anyway.
The fact that the GX still has to use a crappy 8253 PIT for timing and
must emulate the TSC using one of the PIT channels is not helping at
all. Emulating the TSC costs 1 x time_of(outb) + 2 x time_of(inb), each
time a timestamp is read via the rdtsc emulation code. That is costly.
>
> >
> >
> > When you measure that load, what does /proc/xenomai/timerstat say?
> >
> >> I know
> >> there is some overhead with userspace calls but hte irq0 handler
> >> alone
> >> accounts for 20% of it. Are there any options that can speed things
> >> up?
> >>
> >
> > Yeah, but you won't like it: buy a Geode that has SEP support for
> > syscalls and a working TSC, then switch on --enable-x86-sep. Ok,
> > granted, that is _not_ funny.
>
> We have a new Geode that has SEP and yes, things are faster. Just how
> much overhead does syscall create?
It switches to supervisor mode using an interrupt (0x80); that logic is
really costly compared to the SEP entry. I'd say ~800ns-1us vs 200ns on
average for your target.
> Is there no better option other
> than SEP? If we could have kernel threads work without corrupting
> userland FPU contexts then we could use our two higher priority
> drivers in a kernel module to save overhead.
Btw, did you fix your driver code regarding the unprotected usage of FPU
in pure Linux kernel context?
>
> Is TSC really going to make that much of a difference? It seems that
> xenomai uses PIT anyway.
Eh, no. TSC is always preferred when available.
> We can build with TSC if we disable suspend
> on halt and it works. If we do this the usage stays the same. It may
> drop a couple tenths of a percent.
Frankly, those figures are really surprising. rdtsc() is about
100-200ns, running rthal_get_8254_tsc() is a lot, lot more.
>
> > What would be interesting is to get the value reported for the timer
> > interrupt when the standard latency test runs at the same frequency
> > than
> > your application does (use -p option).
>
> So you mean look at cat /proc/stat/xenomai while running latency test -
> p?
>
No, when _your_ test runs.
> Steven
>
--
Philippe.
next prev parent reply other threads:[~2009-03-23 23:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-23 19:59 [Xenomai-core] irq0 usage Steven Seeger
2009-03-23 22:54 ` Philippe Gerum
2009-03-23 23:03 ` Steven Seeger
2009-03-23 23:18 ` Philippe Gerum [this message]
2009-03-23 23:32 ` Steven Seeger
2009-03-24 8:59 ` Philippe Gerum
-- strict thread matches above, loose matches on Subject: below --
2009-03-26 17:25 Steven Seeger
2009-03-26 17:28 ` Steven Seeger
2009-03-26 17:31 ` 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=1237850338.13946.117.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=steven.seeger@domain.hid \
--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.