Some performance measurements on the FreeBSD network stack

John Baldwin jhb at freebsd.org
Fri Apr 20 12:48:07 UTC 2012


On Thursday, April 19, 2012 4:46:22 pm Luigi Rizzo wrote:
> What might be moderately expensive are the critical_enter()/critical_exit()
> calls around individual allocations.
> The allocation happens while the code has already an exclusive
> lock on so->snd_buf so a pool of fresh buffers could be attached
> there.

Keep in mind that in the common case critical_enter() and critical_exit()
should be very cheap as they should just do td->td_critnest++ and
td->td_critnest--.  critical_enter() should probably be inlined if KTR
is not enabled.

-- 
John Baldwin


More information about the freebsd-net mailing list