Skip to content

Commit

Permalink
tcp/dccp: cache line align inet_hashinfo
Browse files Browse the repository at this point in the history
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 <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Aug 4, 2023
1 parent 62c1bff commit 6f5ca18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/net/inet_hashtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 6f5ca18

Please sign in to comment.