All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Pavel Roskin <proski@gnu.org>
Cc: Michael Buesch <mb@bu3sch.de>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 4/7] mac80211: make ieee80211_get_hdrlen_from_skb return unsigned
Date: Fri, 06 Jun 2008 19:24:20 -0700	[thread overview]
Message-ID: <1212805460.6340.91.camel@brick> (raw)
In-Reply-To: <1212783357.29134.5.camel@dv>

On Fri, 2008-06-06 at 16:15 -0400, Pavel Roskin wrote:
> On Fri, 2008-06-06 at 11:47 -0700, Harvey Harrison wrote:
>=20
> > unlikely() isn't some magic make-me-faster function, it just moves =
code
> > to the end of the function to get it out of the icache and jumps to=
 it
> > in the unlikely case it is taken.  When all there is is a return, I
> > don't think it even makes any difference.  In both these cases a co=
mment
> > is probably more appropriate.
>=20
> If we don't more return to the end, we get something like:
>=20
> compare skb->len to 10
> if more or equal goto 1
> return
> 1: <the likely case>
>=20
> =EF=BB=BFI don't know much about modern processor design, but I remem=
ber reading
> that even a very short jump would flush the instruction pipeline and
> cause some delay.
>=20
> I would keep unlikely() and let the compiler think what to do with it=
=2E
>=20

On X86-32 at least the generated code is exactly the same with or
without the unlikely()s.  I'll put them back in a follow-on if people
are really attached to them.

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-06-07  2:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 17:51 [PATCH 4/7] mac80211: make ieee80211_get_hdrlen_from_skb return unsigned Harvey Harrison
2008-06-06 18:24 ` Michael Buesch
2008-06-06 18:47   ` Harvey Harrison
2008-06-06 20:15     ` Pavel Roskin
2008-06-07  2:24       ` Harvey Harrison [this message]
2008-06-09  9:15         ` Johannes Berg
2008-06-09 16:25           ` Harvey Harrison

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=1212805460.6340.91.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=proski@gnu.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.