All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Xin Zhao <jackzxcui1989@163.com>,
	 kerneljasonxing@gmail.com,  willemdebruijn.kernel@gmail.com,
	 edumazet@google.com,  ferenc@fejes.dev
Cc: davem@davemloft.net,  kuba@kernel.org,  pabeni@redhat.com,
	 horms@kernel.org,  netdev@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v10 2/2] net: af_packet: Use hrtimer to do the retire operation
Date: Fri, 05 Sep 2025 12:16:44 -0400	[thread overview]
Message-ID: <willemdebruijn.kernel.ebc40a51f82e@gmail.com> (raw)
In-Reply-To: <20250905144707.2271747-1-jackzxcui1989@163.com>

Xin Zhao wrote:
> On Fri, Sep 5, 2025 at 14:45 +0800 Jason Xing <kerneljasonxing@gmail.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.

+1 that should suffice


  reply	other threads:[~2025-09-05 16:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 14:47 [PATCH net-next v10 2/2] net: af_packet: Use hrtimer to do the retire operation Xin Zhao
2025-09-05 16:16 ` Willem de Bruijn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-09-05  4:00 Xin Zhao
2025-09-05  6:03 ` Jason Xing
2025-09-05  6:45   ` Jason Xing
2025-09-05 16:16     ` Willem de Bruijn
2025-09-06  0:14       ` Jason Xing
2025-09-06 15:25         ` Willem de Bruijn
2025-09-06 15:53           ` Jason Xing
2025-09-04 14:59 Xin Zhao
2025-09-05  0:09 ` Jason Xing
2025-09-03 17:07 Xin Zhao
2025-09-04  3:26 ` Jason Xing
2025-09-03 16:17 Xin Zhao
2025-09-04  2:50 ` Jason Xing
2025-09-01 14:16 Xin Zhao
2025-09-01  2:27 Xin Zhao
2025-09-01 13:35 ` Willem de Bruijn
2025-08-31 10:08 [PATCH net-next v10 0/2] net: af_packet: optimize " Xin Zhao
2025-08-31 10:08 ` [PATCH net-next v10 2/2] net: af_packet: Use hrtimer to do the " Xin Zhao
2025-09-01  1:21   ` Willem de Bruijn
2025-09-02 15:43   ` Jason Xing
2025-09-02 16:42     ` Jason Xing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=willemdebruijn.kernel.ebc40a51f82e@gmail.com \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ferenc@fejes.dev \
    --cc=horms@kernel.org \
    --cc=jackzxcui1989@163.com \
    --cc=kerneljasonxing@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.