All synchronization between queue producer/consumer is performed by the write to
"head". Before this write, none of the queued data is visible from the consumer
point of view.
Therefore, just a single wmb() is required before writing to head to ensure
correct synchronization. This matches with the rmb() after reading head on the
consumer side.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
assert(head - LOAD_SHARED(defer_queue.tail) == 0);
}
- smp_wmb(); /* Publish new pointer before write q[] */
if (unlikely(defer_queue.last_fct_in != fct)) {
defer_queue.last_fct_in = fct;
if (unlikely(DQ_IS_FCT_BIT(fct) || fct == DQ_FCT_MARK)) {
}
}
_STORE_SHARED(defer_queue.q[head++ & DEFER_QUEUE_MASK], p);
- smp_wmb(); /* Write q[] before head. */
+ smp_wmb(); /* Publish new pointer before head */
+ /* Write q[] before head. */
STORE_SHARED(defer_queue.head, head);
}