summaryrefslogtreecommitdiffstats
path: root/include/linux/ptr_ring.h
diff options
context:
space:
mode:
authorAndrea Parri <parri.andrea@gmail.com>2018-02-16 12:06:13 +0100
committerDavid S. Miller <davem@davemloft.net>2018-02-19 11:11:16 -0500
commite3f9f41757f5ce1e95ef3bc3bfb72bbcdb23ece2 (patch)
tree6975ad4371c3284e54919d92e98a935a8111d699 /include/linux/ptr_ring.h
parent1ec010e705934c8acbe7dbf31afc81e60e3d828b (diff)
downloadlinux-e3f9f41757f5ce1e95ef3bc3bfb72bbcdb23ece2.tar.gz
linux-e3f9f41757f5ce1e95ef3bc3bfb72bbcdb23ece2.tar.bz2
linux-e3f9f41757f5ce1e95ef3bc3bfb72bbcdb23ece2.zip
ptr_ring: Remove now-redundant smp_read_barrier_depends()
Because READ_ONCE() now implies smp_read_barrier_depends(), the smp_read_barrier_depends() in __ptr_ring_consume() is redundant; this commit removes it and updates the comments. Signed-off-by: Andrea Parri <parri.andrea@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Jason Wang <jasowang@redhat.com> Cc: John Fastabend <john.fastabend@gmail.com> Cc: Eric Dumazet <edumazet@google.com> Cc: <linux-kernel@vger.kernel.org> Cc: <netdev@vger.kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ptr_ring.h')
-rw-r--r--include/linux/ptr_ring.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h
index b884b7794187..ddfed1dce936 100644
--- a/include/linux/ptr_ring.h
+++ b/include/linux/ptr_ring.h
@@ -296,13 +296,14 @@ static inline void *__ptr_ring_consume(struct ptr_ring *r)
{
void *ptr;
+ /* The READ_ONCE in __ptr_ring_peek guarantees that anyone
+ * accessing data through the pointer is up to date. Pairs
+ * with smp_wmb in __ptr_ring_produce.
+ */
ptr = __ptr_ring_peek(r);
if (ptr)
__ptr_ring_discard_one(r);
- /* Make sure anyone accessing data through the pointer is up to date. */
- /* Pairs with smp_wmb in __ptr_ring_produce. */
- smp_read_barrier_depends();
return ptr;
}