public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netfilter: conntrack: remove __read_mostly from nf_conntrack_generation
@ 2026-01-30  4:43 lirongqing
  2026-01-30 10:32 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: lirongqing @ 2026-01-30  4:43 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	Phil Sutter, David S . Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Simon Horman, netfilter-devel, coreteam, netdev
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

The nf_conntrack_generation sequence counter is updated whenever
conntrack table generations are bumped (e.g., during netns exit or
heavy garbage collection). Under certain workloads, these updates
can be frequent enough that the variable no longer fits the
"read-mostly" criteria.

Applying __read_mostly to a variable that is updated regularly can
lead to cache line bouncing and performance degradation for other
variables residing in the same section. Remove the annotation to
let the variable reside in the standard data section.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 net/netfilter/nf_conntrack_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index d1f8eb7..233a281 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -204,7 +204,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_htable_size);
 
 unsigned int nf_conntrack_max __read_mostly;
 EXPORT_SYMBOL_GPL(nf_conntrack_max);
-seqcount_spinlock_t nf_conntrack_generation __read_mostly;
+seqcount_spinlock_t nf_conntrack_generation;
 static siphash_aligned_key_t nf_conntrack_hash_rnd;
 
 static u32 hash_conntrack_raw(const struct nf_conntrack_tuple *tuple,
-- 
2.9.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-30 11:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-30  4:43 [PATCH] netfilter: conntrack: remove __read_mostly from nf_conntrack_generation lirongqing
2026-01-30 10:32 ` Eric Dumazet
2026-01-30 11:23   ` 答复: [外部邮件] " Li,Rongqing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox