Do not spin on the NET_LOCK() in kqueue

2021-07-10 Thread Martin Pieuchot
One of the reasons for the drop of performances in the kqueue-based poll/select is the fact that kqueue filters are called up to 3 times per syscall and that they all spin on the NET_LOCK() for TCP/UDP packets. Diff below is a RFC for improving the situation. socket kqueue filters mainly check fo

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-10 Thread Vitaliy Makkoveev
Hi, In filt_solisten_common() you touches `so_qlen’ only. It’s not related to buffer and not protected by introduced `sb_mtx’ so the solock() replacement in filt_solisten*() is wrong. However, in filt_solisten_common() you only checks is `so_qlen’ != 0 condition and such check could be performed

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-10 Thread Martin Pieuchot
On 10/07/21(Sat) 21:53, Vitaliy Makkoveev wrote: > Hi, > > In filt_solisten_common() you touches `so_qlen’ only. It’s not > related to buffer and not protected by introduced `sb_mtx’ so > the solock() replacement in filt_solisten*() is wrong. > > However, in filt_solisten_common() you only checks

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-10 Thread Vitaliy Makkoveev
Thanks for explanation. I missed the last commit to sys/kern/uipc_socket.c > On 10 Jul 2021, at 22:56, Martin Pieuchot wrote: > > On 10/07/21(Sat) 21:53, Vitaliy Makkoveev wrote: >> Hi, >> >> In filt_solisten_common() you touches `so_qlen’ only. It’s not >> related to buffer and not protected b

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-11 Thread Visa Hankala
On Sat, Jul 10, 2021 at 05:26:57PM +0200, Martin Pieuchot wrote: > One of the reasons for the drop of performances in the kqueue-based > poll/select is the fact that kqueue filters are called up to 3 times > per syscall and that they all spin on the NET_LOCK() for TCP/UDP > packets. > > Diff below

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-21 Thread Martin Pieuchot
On 11/07/21(Sun) 14:45, Visa Hankala wrote: > On Sat, Jul 10, 2021 at 05:26:57PM +0200, Martin Pieuchot wrote: > > One of the reasons for the drop of performances in the kqueue-based > > poll/select is the fact that kqueue filters are called up to 3 times > > per syscall and that they all spin on t

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-25 Thread Martin Pieuchot
On 21/07/21(Wed) 10:18, Martin Pieuchot wrote: > On 11/07/21(Sun) 14:45, Visa Hankala wrote: > > On Sat, Jul 10, 2021 at 05:26:57PM +0200, Martin Pieuchot wrote: > > > One of the reasons for the drop of performances in the kqueue-based > > > poll/select is the fact that kqueue filters are called up

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-26 Thread Martin Pieuchot
On 26/07/21(Mon) 08:55, Martin Pieuchot wrote: > On 21/07/21(Wed) 10:18, Martin Pieuchot wrote: > > On 11/07/21(Sun) 14:45, Visa Hankala wrote: > > > On Sat, Jul 10, 2021 at 05:26:57PM +0200, Martin Pieuchot wrote: > > > > One of the reasons for the drop of performances in the kqueue-based > > > >

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-29 Thread Martin Pieuchot
On 26/07/21(Mon) 09:23, Martin Pieuchot wrote: > On 26/07/21(Mon) 08:55, Martin Pieuchot wrote: > > On 21/07/21(Wed) 10:18, Martin Pieuchot wrote: > > > On 11/07/21(Sun) 14:45, Visa Hankala wrote: > > > > On Sat, Jul 10, 2021 at 05:26:57PM +0200, Martin Pieuchot wrote: > > > > > One of the reasons

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-29 Thread Claudio Jeker
On Thu, Jul 29, 2021 at 09:51:43AM +0200, Martin Pieuchot wrote: > On 26/07/21(Mon) 09:23, Martin Pieuchot wrote: > > On 26/07/21(Mon) 08:55, Martin Pieuchot wrote: > > > On 21/07/21(Wed) 10:18, Martin Pieuchot wrote: > > > > On 11/07/21(Sun) 14:45, Visa Hankala wrote: > > > > > On Sat, Jul 10, 202

Re: Do not spin on the NET_LOCK() in kqueue

2021-07-29 Thread Alexander Bluhm
> > New diff fixing a locking dance pointed out by visa@. Not tested this one yet. But here is a combination of all the others. http://bluhm.genua.de/perform/results/2021-07-27T07:41:29Z/perform.html bluhm

Re: Do not spin on the NET_LOCK() in kqueue

2021-08-02 Thread Martin Pieuchot
On 29/07/21(Thu) 15:36, Alexander Bluhm wrote: > > > New diff fixing a locking dance pointed out by visa@. > > Not tested this one yet. But here is a combination of all the > others. > > http://bluhm.genua.de/perform/results/2021-07-27T07:41:29Z/perform.html Thanks for testing. These tests sho