diff --git a/include/net/sock.h b/include/net/sock.h index 858891c36f94ad2577726d6d21cf871dbcd55d98..00d09140e35474fb686a41e019d3f82f8920da47 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -907,7 +907,10 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) static inline void sk_incoming_cpu_update(struct sock *sk) { - sk->sk_incoming_cpu = raw_smp_processor_id(); + int cpu = raw_smp_processor_id(); + + if (unlikely(sk->sk_incoming_cpu != cpu)) + sk->sk_incoming_cpu = cpu; } static inline void sock_rps_record_flow_hash(__u32 hash)