Confused by smp_read_barrier_depends() in rxrpc_rotate_tx_window()

From: Paul E. McKenney
Date: Fri May 30 2008 - 08:46:22 EST


Hello, Dave!

I confess to being confused by the smp_read_barrier_depends() in
rxrpc_rotate_tx_window(). It looks like it is ordering the prior
fetch of tail from call->acks_tail with the subsequent use of
tail as an index into the call->acks_window[] array, but then the
code does an assignment to call->acks_tail a few lines later.

If we hold a lock protecting call->acks_tail, why do we need the
smp_read_barrier_depends()? If we don't hold such a lock, why
is the assignment to call->acks_tail safe?

Help?

Thanx, Paul
--
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/