Date: Mon, 4 Nov 2019 00:59:21 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Vladimir Kondratyev <vladimir@kondratyev.su> Cc: Vladimir Kondratyev <wulf@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r354322 - head/sys/dev/ichiic Message-ID: <20191103225921.GZ73312@kib.kiev.ua> In-Reply-To: <abd7b232-76d7-f00d-99fa-b11d3ee3319a@kondratyev.su> References: <201911032117.xA3LHpKK078186@repo.freebsd.org> <20191103220222.GX73312@kib.kiev.ua> <abd7b232-76d7-f00d-99fa-b11d3ee3319a@kondratyev.su>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191103225921.GZ73312>