* [PATCH net-next] tcp/dccp: cache line align inet_hashinfo
@ 2023-08-03 7:53 Eric Dumazet
2023-08-04 8:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2023-08-03 7:53 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, eric.dumazet, Eric Dumazet
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>
---
include/net/inet_hashtables.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 99bd823e97f624e37cf3abb8ac0ec7eef4552b61..74399d20b2184945f2b39bf3dfedb3ae63b500f7 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)
{
--
2.41.0.640.ga95def55d0-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp/dccp: cache line align inet_hashinfo
2023-08-03 7:53 [PATCH net-next] tcp/dccp: cache line align inet_hashinfo Eric Dumazet
@ 2023-08-04 8:30 ` patchwork-bot+netdevbpf
2023-08-04 20:33 ` Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-04 8:30 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, kuba, pabeni, netdev, eric.dumazet
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Thu, 3 Aug 2023 07:53:34 +0000 you wrote:
> 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
>
> [...]
Here is the summary with links:
- [net-next] tcp/dccp: cache line align inet_hashinfo
https://git.kernel.org/netdev/net-next/c/6f5ca184cbef
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp/dccp: cache line align inet_hashinfo
2023-08-04 8:30 ` patchwork-bot+netdevbpf
@ 2023-08-04 20:33 ` Eric Dumazet
2023-08-04 23:13 ` Martin KaFai Lau
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2023-08-04 20:33 UTC (permalink / raw)
To: patchwork-bot+netdevbpf, Martin KaFai Lau
Cc: davem, kuba, pabeni, netdev, eric.dumazet
On Fri, Aug 4, 2023 at 10:30 AM <patchwork-bot+netdevbpf@kernel.org> wrote:
>
> Hello:
>
> This patch was applied to netdev/net-next.git (main)
> by David S. Miller <davem@davemloft.net>:
>
> On Thu, 3 Aug 2023 07:53:34 +0000 you wrote:
> > 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
> >
> > [...]
>
> Here is the summary with links:
> - [net-next] tcp/dccp: cache line align inet_hashinfo
> https://git.kernel.org/netdev/net-next/c/6f5ca184cbef
>
> You are awesome, thank you!
> --
> Deet-doot-dot, I am a bot.
> https://korg.docs.kernel.org/patchwork/pwbot.html
>
>
Thanks !
Apparently this misalignment came with
commit cae3873c5b3a4fcd9706fb461ff4e91bdf1f0120
Author: Martin KaFai Lau <kafai@fb.com>
Date: Wed May 11 17:06:05 2022 -0700
net: inet: Retire port only listening_hash
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] tcp/dccp: cache line align inet_hashinfo
2023-08-04 20:33 ` Eric Dumazet
@ 2023-08-04 23:13 ` Martin KaFai Lau
0 siblings, 0 replies; 4+ messages in thread
From: Martin KaFai Lau @ 2023-08-04 23:13 UTC (permalink / raw)
To: Eric Dumazet; +Cc: davem, kuba, pabeni, netdev, eric.dumazet
On 8/4/23 1:33 PM, Eric Dumazet wrote:
> On Fri, Aug 4, 2023 at 10:30 AM <patchwork-bot+netdevbpf@kernel.org> wrote:
>>
>> Hello:
>>
>> This patch was applied to netdev/net-next.git (main)
>> by David S. Miller <davem@davemloft.net>:
>>
>> On Thu, 3 Aug 2023 07:53:34 +0000 you wrote:
>>> 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
>>>
>>> [...]
>>
>> Here is the summary with links:
>> - [net-next] tcp/dccp: cache line align inet_hashinfo
>> https://git.kernel.org/netdev/net-next/c/6f5ca184cbef
>>
>> You are awesome, thank you!
>> --
>> Deet-doot-dot, I am a bot.
>> https://korg.docs.kernel.org/patchwork/pwbot.html
>>
>>
>
> Thanks !
>
> Apparently this misalignment came with
>
> commit cae3873c5b3a4fcd9706fb461ff4e91bdf1f0120
> Author: Martin KaFai Lau <kafai@fb.com>
> Date: Wed May 11 17:06:05 2022 -0700
>
> net: inet: Retire port only listening_hash
Ah. Thanks for the fix. TIL.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-04 23:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03 7:53 [PATCH net-next] tcp/dccp: cache line align inet_hashinfo Eric Dumazet
2023-08-04 8:30 ` patchwork-bot+netdevbpf
2023-08-04 20:33 ` Eric Dumazet
2023-08-04 23:13 ` Martin KaFai Lau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).