mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
net: avoid dirtying sk->sk_napi_id
sk_napi_id is located in a cache line that can be kept read mostly. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
ef57c1610d
commit
2b13af8ade
@ -130,7 +130,8 @@ static inline void skb_mark_napi_id(struct sk_buff *skb,
|
||||
static inline void sk_mark_napi_id(struct sock *sk, const struct sk_buff *skb)
|
||||
{
|
||||
#ifdef CONFIG_NET_RX_BUSY_POLL
|
||||
WRITE_ONCE(sk->sk_napi_id, skb->napi_id);
|
||||
if (unlikely(READ_ONCE(sk->sk_napi_id) != skb->napi_id))
|
||||
WRITE_ONCE(sk->sk_napi_id, skb->napi_id);
|
||||
#endif
|
||||
sk_rx_queue_set(sk, skb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user