On Mon, Nov 04, 2019 at 01:46:14AM +0300, Vladimir Kondratyev wrote: > On 04.11.2019 01:02, Konstantin Belousov wrote: > > On Sun, Nov 03, 2019 at 09:17:51PM +0000, Vladimir Kondratyev wrote: > >> Author: wulf > >> Date: Sun Nov 3 21:17:50 2019 > >> New Revision: 354322 > >> URL: https://svnweb.freebsd.org/changeset/base/354322 > >> > >> Log: > >> [ig4] Convert ithread interrupt handler to filter based one. > > And why ? > > > > You need some reason to use filters/spinlocks, otherwise it only > > taxes system latency. > > > The only thing ig4 interrupt handler does is a waking up the user > thread, so postponing it to ithread looks like a wasting of CPU cycles. > > Spinlock here is acting as condition variable not as a data protection > lock. It is taken around msleep(). I can replace it with cv_* calls if > current usage confuses someone > > Ig4 access is serialized with sx lock so it is impossible to get any > congestion on spinlock > You need to lock the same spinlock in the sleeping thread and in the interrupt context.
I do not remember why these drivers ended up using sx for their main data synchronization, I suspect it was due to copyouts. _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"