Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2011 17:34:55 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Max Laier <max@love2party.net>
Cc:        neel@freebsd.org, Andriy Gapon <avg@freebsd.org>, Attilio Rao <attilio@freebsd.org>, FreeBSD current <freebsd-current@freebsd.org>, Stephan Uphoff <ups@freebsd.org>, Peter Grehan <grehan@freebsd.org>
Subject:   Re: proposed smp_rendezvous change
Message-ID:  <201105181734.55988.jhb@freebsd.org>
In-Reply-To: <4DD42BC6.80104@love2party.net>
References:  <4DCD357D.6000109@FreeBSD.org> <201105171635.17704.jhb@freebsd.org> <4DD42BC6.80104@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105181734.55988.jhb>