Thread (30 messages) 30 messages, 5 authors, 2017-12-11

Re: [PATCHv2 net-next 04/12] sctp: implement make_datafrag for sctp_stream_interleave

flat view

From: Xin Long <lucien.xin@gmail.com>
Date: 2017-12-08 17:37:15
Also in: netdev

On Sat, Dec 9, 2017 at 1:29 AM, David Laight [off-list ref] wrote:
From: Xin Long ...
quoted
Hi, David, Sorry,  I'm not sure we're worrying about the cpu cost or
codes style now ?

For cpu cost,  I think 0x848(%r13) operation must be better than the
generated code of if-else.
Nope - the call xxx(%ryyy) is likely to be a data cache miss and a complete
cpu pipeline stall.

The conditional will be a data cache hit and the code (for one branch)
will be prefetched and speculatively executed.

Some very modern cpu might manage to predict indirect jumps, but for
most it is a full pipeline stall.
Thanks for the CPU information.

The thing is with if-else can't avoid xxx(%ryyy) in this case, as Marcelo
said above. It seems if-else will just be a extra cost compare to this one.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help