Search Linux Wireless

Re: [PATCH 4/7] mac80211: make ieee80211_get_hdrlen_from_skb return unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2008-06-06 at 16:15 -0400, Pavel Roskin wrote:
> On Fri, 2008-06-06 at 11:47 -0700, Harvey Harrison wrote:
> 
> > 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 comment
> > is probably more appropriate.
> 
> If we don't more return to the end, we get something like:
> 
> compare skb->len to 10
> if more or equal goto 1
> return
> 1: <the likely case>
> 
> I don't know much about modern processor design, but I remember reading
> that even a very short jump would flush the instruction pipeline and
> cause some delay.
> 
> I would keep unlikely() and let the compiler think what to do with it.
> 

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-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux