]> git.baikalelectronics.ru Git - kernel.git/commit
net: avoid potential false sharing in neighbor related code
authorEric Dumazet <edumazet@google.com>
Tue, 5 Nov 2019 22:11:51 +0000 (14:11 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Nov 2019 00:14:48 +0000 (16:14 -0800)
commitbb356fc711b4cf1c66f677f04a243c4650b0355a
treea645c406ef309589a1c6f851ca1ba761575a00b4
parentd1f3b11bf6b732c780aa8147cefa6f060cebe9cc
net: avoid potential false sharing in neighbor related code

There are common instances of the following construct :

if (n->confirmed != now)
n->confirmed = now;

A C compiler could legally remove the conditional.

Use READ_ONCE()/WRITE_ONCE() to avoid this problem.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/arp.h
include/net/ndisc.h
include/net/sock.h