On Wed, Feb 19, 2014 at 03:51:43PM +0100, Johannes Berg wrote: > On Wed, 2014-02-19 at 14:35 +0100, Stanislaw Gruszka wrote: > > > > It ultimately makes no difference at all, it just makes this code more > > > difficult to read and understand. > > > > It make difference when queue length value is modified on different CPU > > and read on different CPU. Without lock you can 'see' old length value > > on CPU that run ieee80211_tx_h_multicast_ps_buf() for undefined > > period of time (ok maybe not undefined on x86), and current oldest > > frame can be not necessarily dropped. > > I don't see how that can be true, since the modifications of the queue > length are under spinlock with the implied memory barriers. On processor that read value there is no memory barrier. If you do: CPU1 CPU2 b = a; spin_lock(a_lock) a = 1; ... spin_unlock(a_lock) b = a; There is nothing that guarantee that on CPU2 b will be 1. Stanislaw -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html