Re: [PATCH] net: af_packet: Use hrtimer to do the retire operation
From: Willem de Bruijn
Date: Sat Aug 09 2025 - 09:45:31 EST
Xin Zhao wrote:
> In a system with high real-time requirements, the timeout mechanism of
> ordinary timers with jiffies granularity is insufficient to meet the
> demands for real-time performance. Meanwhile, the optimization of CPU
> usage with af_packet is quite significant. Use hrtimer instead of timer
> to help compensate for the shortcomings in real-time performance.
> In HZ=100 or HZ=250 system, the update of TP_STATUS_USER is not real-time
> enough, with fluctuations reaching over 8ms (on a system with HZ=250).
> This is unacceptable in some high real-time systems that require timely
> processing of network packets. By replacing it with hrtimer, if a timeout
> of 2ms is set, the update of TP_STATUS_USER can be stabilized to within
> 3 ms.
>
> Signed-off-by: Xin Zhao <jackzxcui1989@xxxxxxx>
This is a resubmit of the patch you yesterday [1]? While the
discussion on the original patch was ongoing too.
Net-next is also closed. See also see also
Documentation/process/maintainer-netdev.rst for the process.
I'll take a closer look later. Agreed in principle that it's
preferable to replace timer with hrtimer than to add a CONFIG to
select between them.
[1] https://lore.kernel.org/netdev/20250808032623.11485-1-jackzxcui1989@xxxxxxx/