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

From: Mathieu Desnoyers
Date: Fri Oct 10 2008 - 01:42:23 EST


* 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.
>

All struct marker_entry.rcu_pending accesses are done with the
markers_mutex held, except the one done in free_old_closure(). Normally,
there should be a
if (entry->rcu_pending)
rcu_barrier_sched();

At the beginning of each markers_mutex section (just after get_marker())
to make sure any pending callback is executed at that point before any
of rcu_pending or ptype are touched.

I just noticed that the "markers: fix unchecked format" patch has a race
with respect to this. I'll post a patch in a jiffy.

Mathieu

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
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/