From: Arjan van de Ven <arjan@infradead.org>
To: Chris Snook <chris.snook@gmail.com>
Cc: john stultz <johnstul@us.ibm.com>,
lkml <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@tglx.de>, Ingo Molnar <mingo@elte.hu>,
Andi Kleen <ak@suse.de>,
nikolag@ca.ibm.com, Darren Hart <dvhltc@us.ibm.com>
Subject: Re: [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE
Date: Sat, 18 Jul 2009 23:14:29 -0700 [thread overview]
Message-ID: <20090718231429.7ddea95f@infradead.org> (raw)
In-Reply-To: <13a12eea0907182000v654e38a5l265ae5bdadb1a175@mail.gmail.com>
On Sat, 18 Jul 2009 23:00:55 -0400
Chris Snook <chris.snook@gmail.com> wrote:
> On Fri, Jul 17, 2009 at 7:39 PM, john stultz<johnstul@us.ibm.com>
> wrote:
> > - if (likely(gtod->sysctl_enabled && gtod->clock.vread))
> > + if (likely(gtod->sysctl_enabled))
>
> This irks me. If the sysctl is enabled and the codepath is getting
> used often enough that we care about performance, branch prediction
> should do the right thing without compiler hints. On the other hand,
> if the sysctl is disabled, and the compiler is telling the cpu to
> ignore its branch predictor, it'll hurt. I don't think we should be
> wrapping (un)likely annotations around configuration options, unless
> we're biasing against debug conditions where we definitely don't care
> about performance. The patch is certainly no worse than the existing
> code, but while we have the hood up, it might be nice to remove the
> annotation, unless we're sure that it does no harm, and does some
> good.
it's on x86.. likely/unlikely don't impact the CPU (since there are no
"ignore the branch predictor" hints), only the code placement.....
(and that's probably a good thing; CPU branch predictors are pretty
good, I'd not be surprised if they're at least as good as the
programmers who think how they code is used)
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
next prev parent reply other threads:[~2009-07-19 6:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-17 23:39 [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE john stultz
2009-07-18 8:30 ` Thomas Gleixner
2009-07-18 22:09 ` john stultz
2009-07-18 22:30 ` Arjan van de Ven
2009-07-20 11:17 ` Peter Zijlstra
2009-07-20 12:22 ` Paul E. McKenney
2009-07-20 13:33 ` Arjan van de Ven
2009-07-20 13:49 ` Peter Zijlstra
2009-07-22 21:39 ` Josh Triplett
2009-07-21 22:31 ` john stultz
2009-07-22 1:26 ` john stultz
2009-08-01 12:21 ` Andy Lutomirski
2009-07-18 12:09 ` Ingo Molnar
2009-07-18 22:20 ` john stultz
2009-07-19 3:00 ` Chris Snook
2009-07-19 6:14 ` Arjan van de Ven [this message]
2009-07-19 6:48 ` Nicholas Miell
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=20090718231429.7ddea95f@infradead.org \
--to=arjan@infradead.org \
--cc=ak@suse.de \
--cc=chris.snook@gmail.com \
--cc=dvhltc@us.ibm.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nikolag@ca.ibm.com \
--cc=tglx@tglx.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