Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: add struct net_aligned_data

This structure will hold networking data that must
consume a full cache line to avoid accidental false sharing.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20250630093540.3052835-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Eric Dumazet and committed by
Jakub Kicinski
3715b5df a8065af3

+19
+16
include/net/aligned_data.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + #ifndef _NET_ALIGNED_DATA_H 3 + #define _NET_ALIGNED_DATA_H 4 + 5 + #include <linux/types.h> 6 + 7 + /* Structure holding cacheline aligned fields on SMP builds. 8 + * Each field or group should have an ____cacheline_aligned_in_smp 9 + * attribute to ensure no accidental false sharing can happen. 10 + */ 11 + struct net_aligned_data { 12 + }; 13 + 14 + extern struct net_aligned_data net_aligned_data; 15 + 16 + #endif /* _NET_ALIGNED_DATA_H */
+3
net/core/hotdata.c
··· 2 2 #include <linux/cache.h> 3 3 #include <linux/jiffies.h> 4 4 #include <linux/list.h> 5 + #include <net/aligned_data.h> 5 6 #include <net/hotdata.h> 6 7 #include <net/proto_memory.h> 7 8 ··· 23 22 .sysctl_mem_pcpu_rsv = SK_MEMORY_PCPU_RESERVE 24 23 }; 25 24 EXPORT_SYMBOL(net_hotdata); 25 + 26 + struct net_aligned_data net_aligned_data;