tun: align write-heavy flow entry members to a cache line
authorLi RongQing <lirongqing@baidu.com>
Thu, 6 Dec 2018 08:08:17 +0000 (16:08 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Dec 2018 20:15:27 +0000 (12:15 -0800)
commit83b1bc122cab87547731a154db5feec5b9d4807c
treed338b04983991a80cc807a0d01282f05076a65d1
parent7a35a50df5a34e6eaee1b1f4f913b84879068fee
tun: align write-heavy flow entry members to a cache line

tun flow entry 'updated' fields are written when receive
every packet. Thus if a flow is receiving packets from a
particular flow entry, it'll cause false-sharing with
all the other who has looked it up, so move it in its own
cache line

and update 'queue_index' and 'update' field only when
they are changed to reduce the cache false-sharing.

Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Wang Li <wangli39@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c