Re: [PATCH] markers: bit-field is not thread-safe nor smp-safe

From: Ingo Molnar
Date: Fri Oct 10 2008 - 03:35:44 EST



* Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx> wrote:

> * Lai Jiangshan (laijs@xxxxxxxxxxxxxx) wrote:
> >
> > bit-field is not thread-safe nor smp-safe.
> >
> > struct marker_entry.rcu_pending is not protected by any lock
> > in rcu-callback free_old_closure().
> > so we must turn it into a safe type.
> >
>
>
> hrm, yes, you are right. I first test for
>
> if (entry->rcu_pending)
> rcu_barrier_sched();
>
> To check if I must execute the rcu callback, and _this_ races against
> the entry->rcu_pending = 0; within the callback.
>
> Your fix is therefore needed.
>
> Thanks !
>
> Acked-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxx>

applied to tip/tracing/markers, thanks guys!

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/