On 18/02/2015 12:57, Pavel Dovgalyuk wrote:
> +#define QSIMPLEQ_INSERT_TAIL_RCU(head, elm, field) do { \
> + (elm)->field.sqe_next = NULL; \
Also, smp_wmb() goes here.
My fault: in the previous review I wrote "smp_wmb() must be after the
(elm) assignment". I meant after the assignment of elm's fields (i.e.
write elm's fields before publishing it) but it wasn't clear at all.
Even better, you can replace the following two lines with:
atomic_rcu_set((head)->sqh_last, (elm));
Paolo
> + *(head)->sqh_last = (elm); \
> + smp_wmb(); \
> + (head)->sqh_last = &(elm)->field.sqe_next; \
> +} while (/*CONSTCOND*/0)
> +