From: Sebastian Andrzej Siewior <bige...@linutronix.de>
Date: Fri, 16 Jun 2017 19:23:59 +0200

> In 2004 [0] netif_rx_ni() gained a preempt_disable() section around
> netif_rx() and its do_softirq() + testing for it. The do_softirq() part
> is required because netif_rx() raises the softirq but does not invoke
> it. The preempt_disable() is required to avoid running the BH in
> parallel.
> All this can be avoided be putting this into a local_bh_disable()ed
> section. The local_bh_enable() part will invoke do_softirq() if
> required.
> 
> [0] Make netif_rx_ni preempt-safe
>     http://oss.sgi.com/projects/netdev/archive/2004-10/msg02211.html
> 
> Signed-off-by: Sebastian Andrzej Siewior <bige...@linutronix.de>

Why make extra work?  The current code is cheaper.

Doing all of that dance with the local_bh_enable() function call is
more expensive than the inlined counter bump and softirq state
check.

I'm not applying this without a better justification, sorry.

Reply via email to