On Fri, Mar 27, 2015 at 01:26:59PM +0000, Fabien Thomas wrote:
F> Author: fabient
F> Date: Fri Mar 27 13:26:59 2015
F> New Revision: 280759
F> URL: https://svnweb.freebsd.org/changeset/base/280759
F> 
F> Log:
F>   On multi CPU systems, we may emit successive packets with the same id.
F>   Fix the race by using an atomic operation.
F>   
F>   Differential Revision:     https://reviews.freebsd.org/D2141
F>   Obtained from:     emeric.pou...@stormshield.eu
F>   MFC after: 1 week
F>   Sponsored by:      Stormshield

The D2141 says that benchmarking were done in presence of IPSEC, which
of course is the bottleneck and performance of this instruction can't
be benchmarked in its presence. Anyway, I believe that results of
right benchmark would still show little difference between atomic and
non-atomic increment of a shared value.

I think we can use per-cpu ID counters, each CPU incrementing its
own. If we start with random values, then probability of two packets with
the same ID emitting at the allowed timeframe will be acceptably small.

-- 
Totus tuus, Glebius.
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to