Re: [PATCH RESEND net-next] net: tcp: tsq: Convert from tasklet to BH workqueue
From: Eric Dumazet
Date: Tue Jun 10 2025 - 10:47:25 EST
On Mon, Jun 9, 2025 at 1:47 PM Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> The only generic interface to execute asynchronously in the BH context is
> tasklet; however, it's marked deprecated and has some design flaws. To
> replace tasklets, BH workqueue support was recently added. A BH workqueue
> behaves similarly to regular workqueues except that the queued work items
> are executed in the BH context.
>
> This patch converts TCP Small Queues implementation from tasklet to BH
> workqueue.
>
> Semantically, this is an equivalent conversion and there shouldn't be any
> user-visible behavior changes. While workqueue's queueing and execution
> paths are a bit heavier than tasklet's, unless the work item is being queued
> every packet, the difference hopefully shouldn't matter.
On a 100Gbit NIC and 32 TX queues, I see about 170,000 calls to
tcp_tsq_workfn() when the link is saturated.
Note that a tasklet could only be raised on the local cpu.
Switching to a work queue allows us to start the work on the cpu who
did the last xmit, thus reducing the load on the cpu servicing the NIC
irqs,
a bit like RFS does on the receive path.
I am tempted to say yes to your patch, hopefully we will not regress
if highprio user threads are competing with this work queue.
Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>