Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2002 13:13:47 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        current@FreeBSD.ORG
Subject:   Re: Patch to improve mutex collision performance
Message-ID:  <Pine.BSF.4.21.0202181310500.52663-100000@InterJet.elischer.org>
In-Reply-To: <200202182021.g1IKLTM36110@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Mon, 18 Feb 2002, Matthew Dillon wrote:

> :
> :I can't see any major problem with this but I can't help thinking that
> :there must be one.. on UP the question is: "who is going to 
> :release the lock if no-one is runnable?"
> 
>     An interrupt, of course.  Wakeups don't happen out of thin air!  This
>     is true of 1.x, 2.x, 3.x, 4.x, 5.x, UP, and SMP.  Something needs to
>     trigger the event that causes the wakeup to occur.
> 
> :can you detail in more clarity the flip-flopping you were seeing?
> 
>     Basically what is happening is that switch/wakeup overhead is being
>     imposed unnecessarily.  There is no need to switch if there is nothing
>     to switch to, and this also causes the other process to not have to
>     wakeup anyone when it releases Giant because process #1 is spinning
>     on it instead of sleeping on it.  So you immediate remove four context
>     switches from the critical path.

true, though the original code would halt the processor to reduce power
consumption on laptops etc. procrunnable doesn't include the idle
process. (a side-effect).


> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0202181310500.52663-100000>