[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250905144707.2271747-1-jackzxcui1989@163.com>
Date: Fri, 5 Sep 2025 22:47:07 +0800
From: Xin Zhao <jackzxcui1989@....com>
To: kerneljasonxing@...il.com,
willemdebruijn.kernel@...il.com,
edumazet@...gle.com,
ferenc@...es.dev
Cc: davem@...emloft.net,
kuba@...nel.org,
pabeni@...hat.com,
horms@...nel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v10 2/2] net: af_packet: Use hrtimer to do the retire operation
On Fri, Sep 5, 2025 at 14:45 +0800 Jason Xing <kerneljasonxing@...il.com> wrote:
> BTW, I have to emphasize that after this patch, the hrtimer will run
> periodically and unconditionally. As far as I know, it's not possible
> to run hundreds and thousands packet sockets in production, so it
> might not be a huge problem. Or else, numerous timers are likely to
> cause spikes/jitters, especially when timeout is very small (which can
> be 1ms timeout for HZ=1000 system). It would be great if you state the
> possible side effects in the next version.
The original logic actually involves an unconditional restart in the timer's
callback. You might be suggesting that if packets come in particularly fast,
the original logic would reset the timeout when opening a new block in
tpacket_rcv, so the timeout does not expire immediately. However, if packets
arrive very quickly, it will also lead to frequent timeout resets, which can
waste CPU resources.
I will emphasize in the comments that the current hrtimer expiration logic
is unconditional and periodic.
Thanks
Xin Zhao
Powered by blists - more mailing lists