On 20/07/21(Tue) 15:46, Alexander Bluhm wrote:
> On Tue, Jul 20, 2021 at 02:26:02PM +0200, Alexander Bluhm wrote:
> > > Note that having multiple threads competing for an exclusive rwlock will
> > > generate unnecessary wakeup/sleep cycles every time the lock is released.
> > > It is valuable to keep this in mind as it might add extra latency when
> > > processing packets.
> > 
> > Of course.  What do you recommend?
> 
> We may have another alternative.
> 
> - Always use a shared net lock but also aquire kernel lock.

Using an exclusive NET_LOCK() seems better, that's what we have now.

My point is just that if we're using an exclusive NET_LOCK() we lose the
gain of having multiple softnet threads, so if we could reduce the
number of threads so would be better.  That said, if it isn't trivial to
do so, I'd better spend the time into making IPsec works with parallel
threads.

Another reason for not using an exclusive lock in the softnet thread is
to be able to execute read ioctls at the same time as the forwarding
path.  This has been reverted due to a bug elsewhere last year and never
got activated again.  But somebody might want to revisit this, 'cause
doing ifconfig(8) on a busy machine was hanging for a very long time.

Reply via email to