]> git.baikalelectronics.ru Git - kernel.git/commit
net: less interrupt masking in NAPI
authorEric Dumazet <edumazet@google.com>
Sun, 2 Nov 2014 14:19:33 +0000 (06:19 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Nov 2014 17:25:09 +0000 (12:25 -0500)
commite6205aa1c6382bd820b2d3b1109f821e3effdad7
tree4e5f935da32ff016c66597727d09b3eb4a1ee6c3
parentebc73f1e3ffff21a7bfea68e1201ffb3d8330ee7
net: less interrupt masking in NAPI

net_rx_action() can mask irqs a single time to transfert sd->poll_list
into a private list, for a very short duration.

Then, napi_complete() can avoid masking irqs again,
and net_rx_action() only needs to mask irq again in slow path.

This patch removes 2 couples of irq mask/unmask per typical NAPI run,
more if multiple napi were triggered.

Note this also allows to give control back to caller (do_softirq())
more often, so that other softirq handlers can be called a bit earlier,
or ksoftirqd can be wakeup earlier under pressure.

This was developed while testing an alternative to RX interrupt
mitigation to reduce latencies while keeping or improving GRO
aggregation on fast NIC.

Idea is to test napi->gro_list at the end of a napi->poll() and
reschedule one NAPI poll, but after servicing a full round of
softirqs (timers, TX, rcu, ...). This will be allowed only if softirq
is currently serviced by idle task or ksoftirqd, and resched not needed.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c