Date: Thu, 26 Feb 2015 09:54:43 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-threads@freebsd.org Subject: Re: umtx_lock MTX_SPIN->MTX_DEF Message-ID: <2605108.iA580FgBvu@ralph.baldwin.cx> In-Reply-To: <20150226103941.GI2379@kib.kiev.ua> References: <20150226103941.GI2379@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, February 26, 2015 12:39:41 PM Konstantin Belousov wrote: > Recent silly discussion on arch@ reminded me about umtx_lock, which is > used by top-half of the kernel, but which is spin lock. Apparently, the > only reason for this is that umtx_thread_exit() is called under the > process spinlock, which put the requirement on the umtx_lock. Note that > the witness static order list is wrong for the umtx_lock, umtx_lock is > explicitely before any thread lock, so it is also before sleepq locks. > I think it went unnoticed because witness for spinlocks currently broken > due to console locks. > > Below is the patch which changes umtx_lock to the sleepable mutex. For the > reason above, I have to move calls to umtx_thread_exit() from thread_exit() > earlier in each caller, when the process spin lock is not yet taken. > > Patch was lightly tested. Please review the idea. Definitely a fan of the idea, and after a cursory look, the patch seems ok. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2605108.iA580FgBvu>