From: David Brownell <david-b@pacbell.net>
To: "Remy Bohmer" <linux@bohmer.net>
Cc: "Haavard Skinnemoen" <hskinnemoen@atmel.com>,
akpm@linux-foundation.org, LKML <linux-kernel@vger.kernel.org>,
"David Brownell" <dbrownell@users.sourceforge.net>,
"Nicolas Ferre" <nicolas.ferre@rfo.atmel.com>,
"Andrew Victor" <linux@maxim.org.za>,
"john stultz" <johnstul@us.ibm.com>,
"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] atmel_tc clocksource/clockevent code
Date: Wed, 5 Mar 2008 05:06:03 -0800 [thread overview]
Message-ID: <200803050506.04291.david-b@pacbell.net> (raw)
In-Reply-To: <3efb10970803050317k68da7154w334561cc5efed637@mail.gmail.com>
On Wednesday 05 March 2008, Remy Bohmer wrote:
> Hello David,
>
> > Could you elaborate on where that 50-100 usec gets spent?
>
> Attached I have put a screendump of my ETM debugger. It shows a
> complete flow of kernel function-calls of what happens on a timer
> interrupt. In this example the complete sequence takes about 154 us.
Thanks -- this is quite informative. (Presumably it'd look similar
using NO_HZ too: hardly any overhead is hardware-specific.)
An ETM trace is really nice for this kind of stuff; it'd be nice
if such tech were more widely available! (Built into most ARM cores
and all that ... but the hardware and software tools to access the
data aren't as available.)
> Notice that the ETM is non-intrusive, and that the times are real and
> accurate in this trace. (you can even see the effects of CPU-caches,
> sometimes the same code just runs faster)
Yeah, the intrusive schemes (like automatic probe insertion) perturb
timings at this level.
> > Does the same issue happpen with the $SUBJECT patch (if you tweak the
> > clocksource ratings to use its clockevents on rm9200)?
>
> not tested yet, but I will generate a trace for it, I will post it later.
Based on how little of that time was spent in the rm9200 clockevent
code -- I'll be generous and call it 10 usec -- I'd can't imagine that
could make much of a real difference.
> There is more to it than just the genIRQ mechanism. The softirqs are
> kicked, the scheduler is triggered and so on. It is a waterfall of
> events that happen, just by having a timer interrupt.
Right.
> > Should the min_delta_ns be increased in at91rm9200_time.c then?
>
> Maybe it should be configurable for these kinds of CPUs?
It shouldn't require tweaking individual clockevent devices, or
IMO be specific to e.g. lower powered CPUs ... but a global
min_delta_ns would be easy to implement, and might help.
That'd resemble what the init_timer_deferrable() mechanism
achieves, but the scale for bunching timers would be fine
not coarse.
> Notice that I also fell in this pitfall while using HRT, and I only
> wanted an application that made a 1ms accurate timer... Other
> processes/daemons in the system also uses timers, which eventually
> resulted in intervals in the sub-millisec range, and thus due to the
> overhead that will bring tot the system, the CPU-load just goes
> sky-high, doing actually nothing really special.
In your case, maybe a global min_delta_ns of 1000 * 1000 would
help ... combine with NO_HZ and you'd get the accuracy you need,
with reduced scheduling overhead. Sound about right?
- Dave
> So, hires timestamps -> really really welcome.
> hires timers -> there should be a (configurable) minimal resolution
> that fits the hardware to not overload the CPU.
>
> > Right now, as you probably recall, it's at the lowest value
> > needed for correctness: a smidgeon over two ticks (~ 72 nsec).
>
> I remember...
>
> Kind Regards,
>
> Remy
>
next prev parent reply other threads:[~2008-03-05 13:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 13:07 [PATCH] atmel_tc library Haavard Skinnemoen
2008-03-04 13:07 ` [PATCH] atmel_tc clocksource/clockevent code Haavard Skinnemoen
2008-03-04 19:42 ` Remy Bohmer
2008-03-04 20:47 ` David Brownell
2008-03-05 11:17 ` Remy Bohmer
2008-03-05 13:06 ` David Brownell [this message]
2008-03-05 16:45 ` Thomas Gleixner
2008-03-05 21:14 ` David Brownell
2008-03-05 22:35 ` Remy Bohmer
2008-03-05 22:52 ` Thomas Gleixner
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=200803050506.04291.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=akpm@linux-foundation.org \
--cc=dbrownell@users.sourceforge.net \
--cc=hskinnemoen@atmel.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@bohmer.net \
--cc=linux@maxim.org.za \
--cc=nicolas.ferre@rfo.atmel.com \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®