On 21-Feb-02 Greg Lehey wrote: > On Monday, 18 February 2002 at 15:38:07 -0500, Jake Burkholder wrote: >> Apparently, On Mon, Feb 18, 2002 at 11:51:44AM -0800, >> Matthew Dillon said words to the effect of; >>> I'm fairly sure JHB does not have a patch to address this but, please, >>> be my guest and check P4. >> >> Actually he does. Maybe you should have checked p4 first yourself. > > Well, maybe, like me, he doesn't know how. I only recently learnt of > the existence of this repo, and I still don't know where it is. It > certainly wasn't announced on the SMP mailing list. I've seen a few > references to p4 there, but no indication of how to access the repo. > >> What John's patch does is spin while the lock owner is running on >> another cpu. Spinning while there are no other processes on the run >> queues as well makes sense but you'll also be doing a lot of >> acquires and releases of sched_lock. > > I must be misinterpreting this statement. Under what circumstances do > you spin? Yes, I read the "while the owner is running in another > CPU", but the way I read that, it turns the blocking lock into a spin > lock.
Only in some cases. This is the classic way of implementing an adaptive mutex. You spin if the other thread is actually executing on another CPU (the idea being it will release the lock soon so you are better off avoiding the context switch) and block if it is not executing on another CPU (releasing the lock is already at least one context switch away, so we might as well switch). > Greg > -- > See complete headers for address and phone numbers > > To Unsubscribe: send mail to [EMAIL PROTECTED] > with "unsubscribe freebsd-current" in the body of the message -- John Baldwin <[EMAIL PROTECTED]> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message