From owner-svn-src-projects@FreeBSD.ORG  Mon Sep 10 18:43:33 2012
Return-Path: <owner-svn-src-projects@FreeBSD.ORG>
Delivered-To: svn-src-projects@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 4DA681065675;
	Mon, 10 Sep 2012 18:43:33 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net
	[IPv6:2001:470:1f10:75::2])
	by mx1.freebsd.org (Postfix) with ESMTP id 1FCF68FC14;
	Mon, 10 Sep 2012 18:43:33 +0000 (UTC)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 75FA3B990;
	Mon, 10 Sep 2012 14:43:32 -0400 (EDT)
From: John Baldwin <jhb@freebsd.org>
To: attilio@freebsd.org
Date: Mon, 10 Sep 2012 14:43:31 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; )
References: <201207301350.q6UDobCI099069@svn.freebsd.org>
	<504CEAE0.704@FreeBSD.org>
	<CAJ-FndBNC-ZheSzJaujCSijXpVZAUEO8F6ZWHEzhFM9C=XvNgA@mail.gmail.com>
In-Reply-To: <CAJ-FndBNC-ZheSzJaujCSijXpVZAUEO8F6ZWHEzhFM9C=XvNgA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201209101443.31207.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7
	(bigwig.baldwin.cx); Mon, 10 Sep 2012 14:43:32 -0400 (EDT)
Cc: Konstantin Belousov <kostikbel@gmail.com>,
	Davide Italiano <davide@freebsd.org>, src-committers@freebsd.org,
	svn-src-projects@freebsd.org
Subject: Re: svn commit: r238907 - projects/calloutng/sys/kern
X-BeenThere: svn-src-projects@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages for the src &quot; projects&quot;
	tree" <svn-src-projects.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-projects>
List-Post: <mailto:svn-src-projects@freebsd.org>
List-Help: <mailto:svn-src-projects-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-projects>, 
	<mailto:svn-src-projects-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Sep 2012 18:43:33 -0000

On Sunday, September 09, 2012 10:07:18 pm Attilio Rao wrote:
> On Sun, Sep 9, 2012 at 8:15 PM, John Baldwin <jhb@freebsd.org> wrote:
> > On 9/9/12 11:03 AM, Attilio Rao wrote:
> >> On 8/2/12, Attilio Rao <attilio@freebsd.org> wrote:
> >>> On 7/30/12, John Baldwin <jhb@freebsd.org> wrote:
> >>
> >> [ trimm ]
> >>
> >>>> --- //depot/projects/smpng/sys/kern/subr_turnstile.c        2012-06-04
> >>>> 18:27:32.000000000 0000
> >>>> +++ //depot/user/jhb/lock/kern/subr_turnstile.c     2012-06-05
> >>>> 00:27:57.000000000 0000
> >>>> @@ -684,6 +684,7 @@
> >>>>     if (owner)
> >>>>             MPASS(owner->td_proc->p_magic == P_MAGIC);
> >>>>     MPASS(queue == TS_SHARED_QUEUE || queue == TS_EXCLUSIVE_QUEUE);
> >>>> +   KASSERT(!TD_IS_IDLETHREAD(td), ("idle threads cannot block on 
locks"));
> >>>>
> >>>>     /*
> >>>>      * If the lock does not already have a turnstile, use this thread's
> >>>
> >>> I'm wondering if we should also use similar checks in places doing
> >>> adaptive spinning (including the TD_NO_SLEEPING check). Likely yes.
> >>
> >> So what do you think about this?
> >
> > This is isn't really good enough then.  An idle thread should not
> > acquire any lock that isn't a spin lock.  Instead, you would be
> > better off removing the assert I added above and adding an assert to
> > mtx_lock(), rw_{rw}lock(), sx_{sx}lock(), lockmgr(), rm_{rw}lock() and
> > all the try variants of those.
> 
> What do you think about these then?

These look good, thanks!

-- 
John Baldwin