Changeset View
Standalone View
sys/dev/cxgb/ulp/tom/cxgb_listen.c
Context not available. | |||||
INP_WLOCK_ASSERT(new_inp); | INP_WLOCK_ASSERT(new_inp); | ||||
if (__predict_false(!(synqe->flags & TP_SYNQE_EXPANDED))) { | if (__predict_false(!(synqe->flags & TP_SYNQE_EXPANDED))) { | ||||
tcp_timer_activate(intotcpcb(new_inp), TT_KEEP, 0); | struct tcpcb *tp; | ||||
tp = intotcpcb(new_inp); | |||||
tp->t_fb->tcp_timer_activate(tp, TT_KEEP, 0); | |||||
jtl: Why store tp locally? There is a cost to adding it to the stack. | |||||
Not Done Inline ActionsOk I have changed this, but do you really think that the compiler with { tp = foomacro() do_someting(tp) } or { do_something(foomacro()) } The compiler underneath will optimize out such behavior.. and I do rrs: Ok I have changed this, but do you really think that the compiler with
-O2 would not optimize… | |||||
Not Done Inline Actions
-O2 would not optimize it.. I would hope so, but I've seen compilers fail to optimize out assignments like this. In one case, we picked up a several percent performance gain by removing a variable assignment like this from a function in a critical path in one of our internal kernel modules. So, while it is nice to trust the compiler to optimize, I prefer to help the compiler along when we can do so without sacrificing clarity. I think this is one of those cases. jtl: > Ok I have changed this, but do you really think that the compiler with
-O2 would not optimize… | |||||
t3_offload_socket(tod, synqe, so); | t3_offload_socket(tod, synqe, so); | ||||
} | } | ||||
Context not available. |
Why store tp locally? There is a cost to adding it to the stack.