netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kurt Kanzenbach <kurt@linutronix.de>
To: Florian Bezdeka <florian.bezdeka@siemens.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: [PATCH net-next] net/core: Enable socket busy polling on -RT
Date: Sat, 28 Oct 2023 12:09:18 +0200	[thread overview]
Message-ID: <87zg033vox.fsf@kurt> (raw)
In-Reply-To: <d085757ed5607e82b1cd09d10d4c9f73bbdf3154.camel@siemens.com>

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

Hi Florian,

On Fri Oct 27 2023, Florian Bezdeka wrote:
> On Tue, 2023-05-23 at 13:15 +0200, Kurt Kanzenbach wrote:
>> Busy polling is currently not allowed on PREEMPT_RT, because it disables
>> preemption while invoking the NAPI callback. It is not possible to acquire
>> sleeping locks with disabled preemption. For details see commit
>> 20ab39d13e2e ("net/core: disable NET_RX_BUSY_POLL on PREEMPT_RT").
>
> Is that something that we could consider as Bug-Fix for 6.1 and request
> a backport, or would you consider that as new feature?

IMO it is in category "never worked". Hence it is not stable material.

>
>> 
>> However, strict cyclic and/or low latency network applications may prefer busy
>> polling e.g., using AF_XDP instead of interrupt driven communication.
>> 
>> The preempt_disable() is used in order to prevent the poll_owner and NAPI owner
>> to be preempted while owning the resource to ensure progress. Netpoll performs
>> busy polling in order to acquire the lock. NAPI is locked by setting the
>> NAPIF_STATE_SCHED flag. There is no busy polling if the flag is set and the
>> "owner" is preempted. Worst case is that the task owning NAPI gets preempted and
>> NAPI processing stalls.  This is can be prevented by properly prioritising the
>> tasks within the system.
>> 
>> Allow RX_BUSY_POLL on PREEMPT_RT if NETPOLL is disabled. Don't disable
>> preemption on PREEMPT_RT within the busy poll loop.
>> 
>> Tested on x86 hardware with v6.1-RT and v6.3-RT on Intel i225 (igc) with
>> AF_XDP/ZC sockets configured to run in busy polling mode.
>
> That is exactly our use case as well and we would like to have it in
> 6.1. Any (technical) reasons that prevent a backport?

There is no technical reason which prevents a backport to v6.1. In fact,
we're using this with v6.1-RT LTS.

Thanks,
Kurt

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

  reply	other threads:[~2023-10-28 10:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 11:15 [PATCH net-next] net/core: Enable socket busy polling on -RT Kurt Kanzenbach
2023-05-25 11:16 ` Paolo Abeni
2023-05-25 13:49   ` Sebastian Andrzej Siewior
2023-05-26  8:00 ` patchwork-bot+netdevbpf
2023-10-27 11:43 ` Florian Bezdeka
2023-10-28 10:09   ` Kurt Kanzenbach [this message]
2023-10-30 11:29     ` Florian Bezdeka
2023-11-08  7:41       ` Kurt Kanzenbach

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=87zg033vox.fsf@kurt \
    --to=kurt@linutronix.de \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.bezdeka@siemens.com \
    --cc=kuba@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).