Re: proposed smp_rendezvous change

From: Max Laier <max_at_love2party.net>
Date: Wed, 18 May 2011 13:27:50 -0700
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.

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.
Received on Wed May 18 2011 - 18:27:56 UTC

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