From owner-freebsd-current  Mon Feb 18 12:51:48 2002
Delivered-To: freebsd-current@freebsd.org
Received: from k6.locore.ca (k6.locore.ca [198.96.117.170])
	by hub.freebsd.org (Postfix) with ESMTP
	id 06A6A37B43C; Mon, 18 Feb 2002 12:51:36 -0800 (PST)
Received: (from jake@localhost)
	by k6.locore.ca (8.11.6/8.11.6) id g1IL98d00585;
	Mon, 18 Feb 2002 16:09:08 -0500 (EST)
	(envelope-from jake)
Date: Mon, 18 Feb 2002 16:09:07 -0500
From: Jake Burkholder <jake@locore.ca>
To: Matthew Dillon <dillon@apollo.backplane.com>
Cc: "David O'Brien" <obrien@FreeBSD.ORG>, current@FreeBSD.ORG
Subject: Re: Patch to improve mutex collision performance
Message-ID: <20020218160907.F96115@locore.ca>
References: <200202181912.g1IJCGK32122@apollo.backplane.com> <20020218114326.A98974@dragon.nuxi.com> <200202181951.g1IJpip33604@apollo.backplane.com> <20020218153807.E96115@locore.ca> <200202182043.g1IKhIc36298@apollo.backplane.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <200202182043.g1IKhIc36298@apollo.backplane.com>; from dillon@apollo.backplane.com on Mon, Feb 18, 2002 at 12:43:18PM -0800
Sender: owner-freebsd-current@FreeBSD.ORG
Precedence: bulk
List-ID: <freebsd-current.FreeBSD.ORG>
List-Archive: <http://docs.freebsd.org/mail/> (Web Archive)
List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions)
List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20freebsd-current>
List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20freebsd-current>
X-Loop: FreeBSD.ORG

Apparently, On Mon, Feb 18, 2002 at 12:43:18PM -0800,
	Matthew Dillon said words to the effect of;

> :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.
> :
> :The only thing that jumped out at me looking at the patch is that critnest cannot
> :be 0 here because the sched_lock is held; holding a spin lock implies being in a
> :critical section.  I need to think about this more and would like you to wait until
> :John has a chance to look at it as well.
> :
> :Jake
> 
>     Sure thing.

Thanks.

> Ah, critnest... you are right.  I should be checking for
>     critnest > 1.

I think you should just leave it alone, don't check critnest at all.
critnest != 1 is illegal because you can't acquire a sleep lock while
in an enclosing critical section.

Jake

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