From owner-freebsd-current@FreeBSD.ORG Thu May 19 11:51:26 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7F83106564A; Thu, 19 May 2011 11:51:26 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6058FC0A; Thu, 19 May 2011 11:51:26 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 27DE446B03; Thu, 19 May 2011 07:51:26 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A75338A050; Thu, 19 May 2011 07:51:25 -0400 (EDT) From: John Baldwin To: Max Laier Date: Wed, 18 May 2011 17:34:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <4DCD357D.6000109@FreeBSD.org> <201105171635.17704.jhb@freebsd.org> <4DD42BC6.80104@love2party.net> In-Reply-To: <4DD42BC6.80104@love2party.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201105181734.55988.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 19 May 2011 07:51:25 -0400 (EDT) Cc: neel@freebsd.org, Andriy Gapon , Attilio Rao , FreeBSD current , Stephan Uphoff , Peter Grehan Subject: Re: proposed smp_rendezvous change X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2011 11:51:26 -0000 On Wednesday, May 18, 2011 4:27:50 pm Max Laier wrote: > On 05/17/2011 01:35 PM, John Baldwin wrote: > ... > > Yeah, I already have a patch to do that, but hadn't added atomic ops to > > critical_enter() and critical_exit(). But it also wasn't as fancy in the > > critical_exit() case. Here is what I have and I think it might actually > > be ok (it doesn't use an atomic read and clear, but I think it is safe). > > Hmm, actually, it will need to use the read and clear: > > Looks good to me. I was slightly surprised by this: > > > Index: kern/kern_synch.c > > =================================================================== > > --- kern/kern_synch.c (revision 222024) > > +++ kern/kern_synch.c (working copy) > > @@ -400,9 +400,7 @@ > > if (!TD_ON_LOCK(td)&& !TD_IS_RUNNING(td)) > > mtx_assert(&Giant, MA_NOTOWNED); > > #endif > > - KASSERT(td->td_critnest == 1 || (td->td_critnest == 2&& > > - (td->td_owepreempt)&& (flags& SW_INVOL) != 0&& > > - newtd == NULL) || panicstr, > > + KASSERT(td->td_critnest == 1 || panicstr, > > ("mi_switch: switch in a critical section")); > > KASSERT((flags& (SW_INVOL | SW_VOL)) != 0, > > ("mi_switch: switch must be voluntary or involuntary")); > > part of the patch. But that is in fact correct and much more expressive > and safe than the version we had before. Ok, I need to stress test this some first. > Thanks, > Max > > P.S. I'd like to see this and the rendezvous changes in stable/7 in the > not too distant future. Mind if I MFH these when you are done - unless > you are planing to do it already, anyways. I will merge them certainly. These are critical fixes. :( -- John Baldwin