On Friday 20 July 2007, Andrew Morton wrote:
> +       for_each_online_node(node) {
>                 struct spu *spu;
>                 mutex_lock(&spu_prio->active_mutex[node]);
>                 list_for_each_entry(spu, &spu_prio->active_list[node], list) {
>                         struct spu_context *ctx = spu->ctx;
>                         set_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags);
> -                       mb();
> +                       mb();   /* make sure any tasks woken up below */
> +                               /* can see the bit(s) set above */
>                         wake_up_all(&ctx->stop_wq);
>                 }
>                 mutex_unlock(&spu_prio->active_mutex[node]);
> _
> 
> I still wonder about that barrier.  At the least it should be smp_mb(). 
> But aren't our set_bit() semantics _alone_ sufficient to make this barrier
> unneeded?

I believe they are sufficient on powerpc, and should be everywhere, so
the mb() can probably go away entirely. set_bit() does a ldarx/stdcx,
which is guaranteed to be atomic across CPUs.

        Arnd <><
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to