From: Jamie Lokier <jamie@shareable.org>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: Pavel Machek <pavel@ucw.cz>, Dave Jones <davej@redhat.com>,
Mitchell Blank Jr <mitch@sfgoth.com>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] oops_in_progress is unlikely()
Date: Wed, 10 Sep 2003 19:31:38 +0100 [thread overview]
Message-ID: <20030910183138.GA23783@mail.jlokier.co.uk> (raw)
In-Reply-To: <Pine.LNX.4.53.0309101147040.14762@chaos>
Richard B. Johnson wrote:
> I would guess that the compiler output might be:
Your guess is incorrect.
> You are always going to take an extra jump in one execution
> path after the function, and you will take a conditional jump
> before the function call in the other execution path. So, you
> always have the "extra" jumps, no matter.
That is not true. The "likely" path has no taken jumps.
Think about the code again.
How would you optimise it, if you were writing assembly language yourself?
(In more complex examples, another factor is that mis-predicted
conditional jumps are much slower than unconditional jumps, so it is
good to favour the latter in the likely path).
-- Jamie
next prev parent reply other threads:[~2003-09-10 18:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-07 6:42 [PATCH] oops_in_progress is unlikely() Mitchell Blank Jr
2003-09-07 22:13 ` Dave Jones
2003-09-10 14:20 ` Pavel Machek
2003-09-10 14:23 ` Dave Jones
2003-09-10 15:29 ` Pavel Machek
2003-09-10 16:07 ` Richard B. Johnson
2003-09-10 18:31 ` Jamie Lokier [this message]
2003-09-10 18:58 ` Richard B. Johnson
2003-09-10 19:02 ` Pavel Machek
2003-09-10 20:12 ` Jamie Lokier
2003-09-10 20:32 ` Richard B. Johnson
2003-09-10 21:27 ` Pavel Machek
2003-09-10 21:52 ` Jamie Lokier
2003-09-10 21:46 ` Jamie Lokier
2003-09-12 5:12 ` Mitchell Blank Jr
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=20030910183138.GA23783@mail.jlokier.co.uk \
--to=jamie@shareable.org \
--cc=akpm@osdl.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mitch@sfgoth.com \
--cc=pavel@ucw.cz \
--cc=root@chaos.analogic.com \
/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;
as well as URLs for NNTP newsgroup(s).