altq spinlock and if_start dispatch

Matthew Dillon dillon at apollo.backplane.com
Mon Apr 14 15:27:54 PDT 2008


:hardware network drivers.  For ether_output(), all code before
:ifnet.if_start() do not need ifnet's serializer, if we dispatch
:if_start then whole ether_output will not need ifnet serializer.  14
:pseudo devices use their own if_output and need to hold serializer.
:After investigating all if_output calling and their implementation, I
:think pushing down ifnet serializer holding into if_output
:implementation (note: not each driver :) is as easy as holding ifnet
:serializer by callers.  By pushing down ifnet serializer holding, we
:could also completely eliminate ifnet serializer holding cost, if the
:if_output implementation does not need to hold ifnet serializer (e.g.
:ether_output after patching and other 6 pseudo devices)
:...
:Best Regards,
:sephe

    Ok, sounds good.

    Definitely use KTR, it's really a cool utility.

    Be sure to turn on cpu synchronization, aka debug.ktr.resynchronize=1,
    and use the -s option to ktrdump to merge all the cpus into one
    time-sorted log.

    Resynchronization basically does an IPI sequence once a second to
    figure out the TSC differences between the cpu's and correct for it.
    It isn't perfect (there's some slew in inter-cpu numbers which can
    be seen if you run the pingpong KTR test), but it's far better then
    not having any synchronization at all.

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>





More information about the Kernel mailing list