From owner-cvs-all@FreeBSD.ORG  Thu Sep 16 19:40:25 2004
Return-Path: <owner-cvs-all@FreeBSD.ORG>
Delivered-To: cvs-all@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 94B9216A4CE; Thu, 16 Sep 2004 19:40:25 +0000 (GMT)
Received: from ylpvm01.prodigy.net (ylpvm01-ext.prodigy.net [207.115.57.32])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 34D9943D48; Thu, 16 Sep 2004 19:40:25 +0000 (GMT)
	(envelope-from nate@root.org)
Received: from [10.0.0.34] (adsl-67-127-84-57.dsl.snfc21.pacbell.net
	[67.127.84.57])i8GJeKbN015321;	Thu, 16 Sep 2004 15:40:20 -0400
Message-ID: <4149EC27.9080200@root.org>
Date: Thu, 16 Sep 2004 12:40:23 -0700
From: Nate Lawson <nate@root.org>
User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040901)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: Pawel Jakub Dawidek <pjd@FreeBSD.org>, cvs-src@FreeBSD.org,
	cvs-all@FreeBSD.org, src-committers@FreeBSD.org
References: <20040916185923.2F92316A552@hub.freebsd.org>
In-Reply-To: <20040916185923.2F92316A552@hub.freebsd.org>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Subject: Re: cvs commit: src/sys/dev/md md.c
X-BeenThere: cvs-all@freebsd.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: CVS commit messages for the entire tree <cvs-all.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-all>,
	<mailto:cvs-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/cvs-all>
List-Post: <mailto:cvs-all@freebsd.org>
List-Help: <mailto:cvs-all-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/cvs-all>,
	<mailto:cvs-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 16 Sep 2004 19:40:25 -0000

Pawel Jakub Dawidek wrote:
> pjd         2004-09-16 18:59:19 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/dev/md           md.c 
>   Log:
>   First wakeup, then unlock.
>   
>   Revision  Changes    Path
>   1.136     +1 -2      src/sys/dev/md/md.c
> 
>
> @@ -379,9 +379,8 @@
>  	bp->bio_bcount = bp->bio_length;
>  	mtx_lock(&sc->queue_mtx);
>  	bioq_disksort(&sc->bio_queue, bp);
> -	mtx_unlock(&sc->queue_mtx);
> -
>  	wakeup(sc);
> +	mtx_unlock(&sc->queue_mtx);
>  }

I think the original order is correct since you can occur 2 switches if 
you wakeup first and then unlock.

-Nate