From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: linux-usb@vger.kernel.org,
Yehezkel Bernat <YehezkelShB@gmail.com>,
Andreas Noever <andreas.noever@gmail.com>,
Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>
Subject: Re: [PATCH 5/5] thunderbolt: stream: Add support for busy polling
Date: Thu, 30 Jul 2026 06:44:20 +0200 [thread overview]
Message-ID: <20260730044420.GB20844@black.igk.intel.com> (raw)
In-Reply-To: <amoSnhr833oztrqK@wunner.de>
Hi,
On Wed, Jul 29, 2026 at 04:47:58PM +0200, Lukas Wunner wrote:
> On Tue, Jul 28, 2026 at 01:51:41PM +0200, Mika Westerberg wrote:
> > Using interrupts and scheduling workers increase latency so latency
> > critical applications may want to avoid that. Make this possible in
> > USB4STREAM by adding a new ConfigFS attribute: busy_poll that, when
> > activated switches the rings to polling mode. The cost for lower latency
> > is that this burns more CPU cycles and things like poll(2) cannot be
> > used.
>
> Hm, would it be possible to auto-detect whether polling is more performant
> for the current workload and automatically enable and disable it?
> E.g. by counting the number of interrupts in a given interval and
> enabling/disabling polling based on a high water mark / low water mark?
> Those marks could then be finetuned from user space, but moving in and
> out of polling automatically would be more desirable I think. Forcing
> polling could be achieved by setting the water marks to a special value,
> e.g. 0 or UINT_MAX.
I think the applications that want the minimal latency and end up setting
this will put it to the "minimal" anyway (because they don't tolerate any
additional latencies caused by interrupts and the worker scheduling) and
for the rest they can already tune this by setting non-default values to
"throttling" attribute (eg. 0 to avoid it completely, makes latency lower
while still keeping it from hogging the CPU fully).
We can introduce auto-tuning mode afterwards as you suggest if it turns out
to be wanted feature.
prev parent reply other threads:[~2026-07-30 4:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 11:51 [PATCH 0/5] thunderbolt: USB4STREAM improvements Mika Westerberg
2026-07-28 11:51 ` [PATCH 1/5] thunderbolt: stream: Restore consumer if copying from iter fails Mika Westerberg
2026-07-28 11:51 ` [PATCH 2/5] thunderbolt: stream: Fix possible short reads/writes Mika Westerberg
2026-07-28 11:51 ` [PATCH 3/5] thunderbolt: stream: Support IOCB_NOWAIT in non-blocking I/O as well Mika Westerberg
2026-07-28 11:51 ` [PATCH 4/5] thunderbolt: Make interrupt optional for rings Mika Westerberg
2026-07-28 11:51 ` [PATCH 5/5] thunderbolt: stream: Add support for busy polling Mika Westerberg
2026-07-29 14:47 ` Lukas Wunner
2026-07-30 4:44 ` Mika Westerberg [this message]
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=20260730044420.GB20844@black.igk.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=alan.borzeszkowski@linux.intel.com \
--cc=andreas.noever@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
/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