From owner-freebsd-current Mon Feb 18 13:35: 9 2002 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id DB0F737B400 for ; Mon, 18 Feb 2002 13:35:04 -0800 (PST) Received: (from dillon@localhost) by apollo.backplane.com (8.11.6/8.9.1) id g1ILYXi42633; Mon, 18 Feb 2002 13:34:33 -0800 (PST) (envelope-from dillon) Date: Mon, 18 Feb 2002 13:34:33 -0800 (PST) From: Matthew Dillon Message-Id: <200202182134.g1ILYXi42633@apollo.backplane.com> To: Julian Elischer Cc: current@FreeBSD.ORG Subject: Re: Patch to improve mutex collision performance References: Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG :> :> :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). That would still work, the spin only occurs when multiple cpus are vying for a sleep lock. But it's moot now, something isn't working as expected. It's as though procrunnable() is broken. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message