if: Use critical section on ifnet.if_start path
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 4 Jan 2014 06:57:49 +0000 (14:57 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 7 Jan 2014 08:35:10 +0000 (16:35 +0800)
commitac7fc6f053a83466adad627e03f401b92a97a3c8
treeb90ad65328ce0f78d9f2709c2c9d053df233e65d
parent24befe94b31f6491cdca91f4f4f87bbd74787db1
if: Use critical section on ifnet.if_start path

This is mainly used to avoid contention on serializer between netisr
and ithread on the same CPU, when ithread preempts netisr which holds
serializer that ithread wants to aquire.

This kind of contention is found by analysing ktr(9) log of the
serializer operations.

Tested on 8 HT (i7-3770) box, using kq_accept_server/kq_connect_client:
- 4/4 TX/RX rings device (BCM5719, using MSI-X), slight improvement.
- 8/8 TX/RX rings device (Intel 82580, using MSI-X), slight improvement.
- 1/2 TX/RX rings device (Intel 82599, using MSI), slight improvement.
sys/net/if.c