Re: proposed smp_rendezvous change

From: John Baldwin <jhb_at_freebsd.org>
Date: Wed, 18 May 2011 17:34:55 -0400
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)
> > _at__at_ -400,9 +400,7 _at__at_
> >   	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
Received on Thu May 19 2011 - 09:51:26 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:14 UTC