From: Eric Dumazet Date: Thu, 3 Aug 2023 07:53:34 +0000 (+0000) Subject: tcp/dccp: cache line align inet_hashinfo X-Git-Tag: v6.6.17~4098^2~227 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f5ca184cbef6d2b78772a350a3ed8be696b54a2;p=platform%2Fkernel%2Flinux-rpi.git tcp/dccp: cache line align inet_hashinfo I have seen tcp_hashinfo starting at a non optimal location, forcing input handlers to pull two cache lines instead of one, and sharing a cache line that was dirtied more than necessary: ffffffff83680600 b tcp_orphan_timer ffffffff83680628 b tcp_orphan_cache ffffffff8368062c b tcp_enable_tx_delay.__tcp_tx_delay_enabled ffffffff83680630 B tcp_hashinfo ffffffff83680680 b tcp_cong_list_lock After this patch, ehash, ehash_locks, ehash_mask and ehash_locks_mask are located in a read-only cache line. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller --- diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 1177eff..8435572 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h @@ -177,7 +177,7 @@ struct inet_hashinfo { struct inet_listen_hashbucket *lhash2; bool pernet; -}; +} ____cacheline_aligned_in_smp; static inline struct inet_hashinfo *tcp_or_dccp_get_hashinfo(const struct sock *sk) {