mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	net: avoid dirtying sk->sk_rx_queue_mapping
sk_rx_queue_mapping is located in a cache line that should 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
							
								
									2b13af8ade
								
							
						
					
					
						commit
						342159ee39
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1916,10 +1916,8 @@ static inline void sk_rx_queue_set(struct sock *sk, const struct sk_buff *skb)
 | 
			
		|||
	if (skb_rx_queue_recorded(skb)) {
 | 
			
		||||
		u16 rx_queue = skb_get_rx_queue(skb);
 | 
			
		||||
 | 
			
		||||
		if (WARN_ON_ONCE(rx_queue == NO_QUEUE_MAPPING))
 | 
			
		||||
			return;
 | 
			
		||||
 | 
			
		||||
		sk->sk_rx_queue_mapping = rx_queue;
 | 
			
		||||
		if (unlikely(READ_ONCE(sk->sk_rx_queue_mapping) != rx_queue))
 | 
			
		||||
			WRITE_ONCE(sk->sk_rx_queue_mapping, rx_queue);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue