flowtable, collisions, locking and CPU affinity
Ryan Stone
rysto32 at gmail.com
Sat Feb 8 01:05:58 UTC 2014
On Fri, Feb 7, 2014 at 7:12 PM, Adrian Chadd <adrian at freebsd.org> wrote:
> In any case - the reason it's happening above is because there's no
> actual lock held over the whole lookup/insert path. It's a per-CPU
> critical enter/exit path, so the only way to guarantee consistency is
> to use sched_pin() for the entirety of the function.
sched_pin seems like a very heavy hammer for what has to be a very
rare and mostly harmless race. Why not redo the lookup after you have
reacquired the lock, and if you don't have to do the insert anymore
then don't and move on?
More information about the freebsd-net
mailing list