From: johan.adolfsson@axis.com
To: "Oliver Xymoron" <oxymoron@waste.org>, <johan.adolfsson@axis.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] Improved add_timer_randomness for __CRIS__ (instead of rdtsc())
Date: Wed, 21 Aug 2002 11:11:24 +0200 [thread overview]
Message-ID: <018001c248f2$b9283260$b9b270d5@homeip.net> (raw)
In-Reply-To: <20020820230023.GA19951@waste.org>
From: "Oliver Xymoron" <oxymoron@waste.org>
> On Wed, Aug 21, 2002 at 12:17:26AM +0200, johan.adolfsson@axis.com wrote:
>
> > I just compared the generated asm:
> > Accurate timestamp scaled to ns: 45 instructions (resolution actually 40
ns)
> > Approximate 40 ns resolution: 21 instructions
> > Approximate 40 us resolution: 9 instructions
> > For comparison one syscall path (gettimeofday()) is approx 400
instructions
> > and the add_timer_randomness() function that only uses jiffies is 76
> > instructions, so mayby I'm microoptimising here?
> > Is it worth the cycles to get 40 ns resolution instead of 40us ?
>
> Seems like it's probably worth the effort. In practice, such
> difference often are lost in the noise compared to cache flushes, etc.
> Does the 'correct' code suffer branch penalties or the like that might
> make it significantly worse than the quick code? If not, then I'd say
> definitely use it.
The correct code has two potential branches instead of one and also
need to stack one register when I have them in functions, but that might
change if the function is inlined in add_timer_randomness().
I can shave off a few instruction if I don't scale it to ns but instead
transform it to a plain 25MHz counter which is what we want anyway I guess.
BTW: I think the trust_pct approach looks nice adn I hope it gets included.
/Johan
prev parent reply other threads:[~2002-08-21 9:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-20 9:31 johan.adolfsson
2002-08-20 14:03 ` Oliver Xymoron
2002-08-20 16:32 ` johan.adolfsson
2002-08-20 17:06 ` Oliver Xymoron
2002-08-20 17:34 ` johan.adolfsson
2002-08-20 18:02 ` Oliver Xymoron
2002-08-20 19:20 ` johan.adolfsson
2002-08-20 19:34 ` Oliver Xymoron
2002-08-20 22:17 ` johan.adolfsson
2002-08-20 23:00 ` Oliver Xymoron
2002-08-21 9:11 ` johan.adolfsson [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='018001c248f2$b9283260$b9b270d5@homeip.net' \
--to=johan.adolfsson@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oxymoron@waste.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 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®