Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NET_MPSAFE [was Re: CVS commit: src/sys]



On Mon, Dec 12, 2016 at 5:24 PM, Nick Hudson <skrll%netbsd.org@localhost> wrote:
> On 11/28/16 09:43, Ryota Ozaki wrote:
>>
>> On Mon, Nov 28, 2016 at 4:29 PM, Nick Hudson <skrll%netbsd.org@localhost> wrote:
>
>
>> This is hurting me again.
>
>
> FYI
>
>
> https://nxr.netbsd.org/xref/src/sys/dev/usb/if_axe.c#527
>
> I think we need NET_MPSAFE finished for netbsd-8

Further investigations show that even if we enable NET_MPSAFE by default,
there are cases that calling driver Tx with holding softnet_lock. For
example, packet transmission via a unconnected socket and TCP syn ack
(tcp_input still needs softnet_lock).

So I have brought another idea to address the issue: Tx softint; it
defers if_start to softint, which is implemented with deferred if_start.
By doing so, driver's if_start is called without holding softnet_lock.
Note that of course the feature is only enabled for drivers that request it.

This is a patch: http://www.netbsd.org/~ozaki-r/tx_softint.diff
The patch includes changes to if_axe for an example.

The drawback of the approach is of course performance degradation.
I tried it with vioif and saw 3% down on iperf. I haven't tested
it using USB devices, so I don't know the performance impact on USB Tx.

Nick, how do you think the approach? And can you try the patch and
benchmark if the approach satisfies you?

Note that this is a tentative solution for netbsd-8. The ideal solution
is still to get rid of softnet_lock completely.

  ozaki-r


Home | Main Index | Thread Index | Old Index