Advice on a multithreaded netisr patch?
rwatson at FreeBSD.org
Wed Apr 8 06:16:54 PDT 2009
On Wed, 8 Apr 2009, Barney Cordoba wrote:
> Is there any work being done on lighter weight locks for queues? It seems
> ridiculous to avoid using queues because of lock contention when the locks
> are only protecting a couple lines of code.
My reading is that there are two, closely related, things going on: the first
is lock contention, and the second is cache line contention. We have a
primitive in 8.x (don't think it's been MFC'd yet) for a lockless atomic
buffer primitive for use in drivers and other parts of the stack. However,
that addresses only lock contention, not line contention, which at a high PPS
will be an issue as well. Only by moving to independent data structures
(i.e., on independent cache lines) can we reduce line contention.
Robert N M Watson
University of Cambridge
More information about the freebsd-net