Re: [PATCH v2 5/6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

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

 



> > +	num_element =
> > +	    es58x_msg_num_element(es58x_dev->dev,
> > +				  bulk_rx_loopback_msg->rx_loopback_msg,
> > +				  msg_len);
> > +	if (unlikely(num_element <= 0))
> > +		return num_element;
> 
> Meta-comment on your use of 'unlikely' everywhere.  Please drop it, it's
> only to be used if you can actually measure the difference in a
> benchmark.  You are dealing with USB devices, which are really really
> slow here.  Also, humans make horrible guessers for this type of thing,
> the compiler and CPU can get this right much more often than we can, and
> we had the numbers for it (someone measured that 80-90% of our usages of
> these markings are actually wrong on modern cpus).
> 
> So just drop them all, it makes the code simpler to read and understand,
> and the cpu can actually go faster.

All those branch on which the unlikely() macro were applied were
supposed to never been executed under normal circumstances. But I
indeed have no benchmark to claim such use.

Thank you for the detailed explanation, makes perfect sense. Each use
of the likely()/unlikely() macros will be removed in v3 revision.



[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux