diff options
| author | Eric Dumazet <edumazet@google.com> | 2026-02-16 14:28:29 +0000 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:20:23 -0500 |
| commit | 3f483a90634d6ea1c1d5dee79cca62eea6e9610d (patch) | |
| tree | 0ea6ec6784b4bcf8e484acfceb88abfc17cbe94a /include/net/netns | |
| parent | c9141a794fdca131f37494a9ff76d12b094118b0 (diff) | |
| download | linux-3f483a90634d6ea1c1d5dee79cca62eea6e9610d.tar.gz linux-3f483a90634d6ea1c1d5dee79cca62eea6e9610d.tar.bz2 linux-3f483a90634d6ea1c1d5dee79cca62eea6e9610d.zip | |
inet: move icmp_global_{credit,stamp} to a separate cache line
[ Upstream commit 87b08913a9ae82082e276d237ece08fc8ee24380 ]
icmp_global_credit was meant to be changed ~1000 times per second,
but if an admin sets net.ipv4.icmp_msgs_per_sec to a very high value,
icmp_global_credit changes can inflict false sharing to surrounding
fields that are read mostly.
Move icmp_global_credit and icmp_global_stamp to a separate
cacheline aligned group.
Fixes: b056b4cd9178 ("icmp: move icmp_global.credit and icmp_global.stamp to per netns storage")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260216142832.3834174-3-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/net/netns')
| -rw-r--r-- | include/net/netns/ipv4.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h index 3d7e03847b5b..521529e61ae1 100644 --- a/include/net/netns/ipv4.h +++ b/include/net/netns/ipv4.h @@ -74,6 +74,12 @@ struct netns_ipv4 { int sysctl_tcp_rmem[3]; __cacheline_group_end(netns_ipv4_read_rx); + /* ICMP rate limiter hot cache line. */ + __cacheline_group_begin_aligned(icmp); + atomic_t icmp_global_credit; + u32 icmp_global_stamp; + __cacheline_group_end_aligned(icmp); + struct inet_timewait_death_row tcp_death_row; struct udp_table *udp_table; @@ -118,8 +124,7 @@ struct netns_ipv4 { int sysctl_icmp_ratemask; int sysctl_icmp_msgs_per_sec; int sysctl_icmp_msgs_burst; - atomic_t icmp_global_credit; - u32 icmp_global_stamp; + u32 ip_rt_min_pmtu; int ip_rt_mtu_expires; int ip_rt_min_advmss; |
