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.

This seems to be a quick fix for all the MP problmes when running
in parallel.  Then the kernel lock can be removed step by step.

I will create a diff an test.

bluhm

> - Develop outside of the tree until all problems are fixed.
> - Delay work on parallel forwarding until IPsec is MP safe.
> - Accept a possible slowdown of IPsec.  In my measurements it gets
>   faster even with the exclusive lock.
> - Concentrate on making IPsec faster.  By removing the crypto
>   queues you gain much more performance than the exclusive lock may
>   cost.  Did you see the massive kernel locks in my graph?
>   
> http://bluhm.genua.de/perform/results/latest/patch-sys-ip-multiqueue.1/btrace/ssh_perform%40lt13_iperf3_-c10.4.56.36_-P10_-t10_-R-btrace-kstack.0.svg
> - Make ARP MP safe.  Currently we need the kernel lock there or
>   it crashes.  This creates latency for all kind of packets.
> - Convert the rwlock in pf to mutex.  I think your argument counts
>   much more there.  But I cannot prove it.
> 
> My plan is to commit what we have and improve where most pain is.
> This makes incremental steps easier.
> 
> bluhm

Reply via email to