Date: Mon, 22 Oct 2018 12:26:46 +0200 From: Hans Petter Selasky <hps@selasky.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339582 - head/sys/dev/sound/midi Message-ID: <e4859526-b49f-b46b-a754-1bf88ac22e40@selasky.org> In-Reply-To: <20181022102016.GO5335@kib.kiev.ua> References: <201810220858.w9M8wSBZ039042@repo.freebsd.org> <20181022095131.GN5335@kib.kiev.ua> <cc0210c5-99c7-1153-0b32-4cfdc576970a@selasky.org> <20181022102016.GO5335@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On 10/22/18 12:20 PM, Konstantin Belousov wrote:
> Then why do you need to re-acquire the mutex after uiomove ?
Hi,
Because the code is factored this way:
mtx_lock();
while (uio->uio_resid > 0) {
	do state checks()
	mtx_unlock();
	retval = uiomove();
	mtx_lock();
}
mtx_unlock();
Yes, you're right the last mtx_lock() can be optimised away. I'm leaving 
that to somebody else. This code typically is processing MIDI events at 
very slow rates like 8KBytes/s and does not need to be very fast.
--HPS
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e4859526-b49f-b46b-a754-1bf88ac22e40>
