[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <13de94827815469193e10d6fb0c0d45b@baidu.com>
Date: Wed, 15 Oct 2025 01:56:35 +0000
From: "Li,Rongqing" <lirongqing@...du.com>
To: Florian Westphal <fw@...len.de>
CC: Pablo Neira Ayuso <pablo@...filter.org>, Jozsef Kadlecsik
<kadlec@...filter.org>, Phil Sutter <phil@....cc>, "David S . Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman
<horms@...nel.org>, "netfilter-devel@...r.kernel.org"
<netfilter-devel@...r.kernel.org>, "coreteam@...filter.org"
<coreteam@...filter.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [????] Re: [PATCH net-next] netfilter: conntrack: Reduce
cond_resched frequency in gc_worker
> > The current implementation calls cond_resched() in every iteration of
> > the garbage collection loop. This creates some overhead when
> > processing large conntrack tables with billions of entries, as each
> > cond_resched() invocation involves scheduler operations.
> >
> > To reduce this overhead, implement a time-based throttling mechanism
> > that calls cond_resched() at most once per millisecond. This maintains
> > system responsiveness while minimizing scheduler contention.
> >
> > gc_worker() with hashsize=10000 shows measurable improvement:
> >
> > Before: 7114.274us
> > After: 5993.518us (15.8% reduction)
>
> I dislike this, I have never seen this pattern.
>
This patch is similar as
commit 271557de7cbfdecb08e89ae1ca74647ceb57224f
xfs: reduce the rate of cond_resched calls inside scrub
> Whole point of cond_resched() is to let scheduler decide.
>
> Maybe it would be better to move gc_worker off to its own work queue
> (create_workqueue()) instead of reusing system wq so one can tune the
> priority instead?
I am fine to move gc_worker to its own work queue
Thanks
-Li
Powered by blists - more mailing lists