From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: linux-kernel@vger.kernel.org,
Lucas De Marchi <lucas.demarchi@intel.com>,
Dibin Moolakadan Subrahmanian
<dibin.moolakadan.subrahmanian@intel.com>,
Imre Deak <imre.deak@intel.com>,
David Laight <david.laight.linux@gmail.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Matt Wagantall <mattw@codeaurora.org>,
Dejin Zheng <zhengdejin5@gmail.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 4/4] DO-NOT-MERGE: drm/i915: Use poll_timeout_us()
Date: Thu, 3 Jul 2025 15:50:59 +0300 [thread overview]
Message-ID: <aGZ8s2mQCmvYK7w1@intel.com> (raw)
In-Reply-To: <9bca3e31879af4ba4abd9cb3c5bd89e80ec013f1@intel.com>
On Thu, Jul 03, 2025 at 03:12:39PM +0300, Jani Nikula wrote:
> On Thu, 03 Jul 2025, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Make sure poll_timeout_us() works by using it in i915
> > instead of the custom __wait_for().
> >
> > Remaining difference between two:
> > | poll_timeout_us() | __wait_for()
> > ---------------------------------------------------
> > backoff | fixed interval | exponential
> > usleep_range() | N/4+1 to N | N to N*2
> > clock | MONOTONIC | MONOTONIC_RAW
> >
> > Just a test hack for now, proper conversion probably
> > needs actual thought.
>
> Agreed.
>
> I feel pretty strongly about converting everything to use
> poll_timeout_us() and poll_timeout_us_atomic() directly. I think the
> plethora of wait_for variants in i915_utils.h is more confusing than
> helpful (even if some of them are supposed to be "simpler"
> alternatives). I also think the separate atomic variant is better than
> magically deciding that based on delay length.
>
> I'm also not all that convinced about the exponential wait. Not all of
> the wait_for versions use it, and then it needs to have a max wait
> anyway (we have an issue with xe not having that [1]). I believe callers
> can decide on a sleep length that is appropriate for the timeout, case
> by case, and gut feeling says it's probably fine. ;)
Yeah, we've not really done any work to justify the polling interval/backoff
strategy. At some point it would be nice to collect some statistics to see
what the typical wait durations are, and then perhaps tune the polling
interval on a case by case basis to be at least somewhat optimal (short
enough to not cause significant delays, but long enough to avoid excessive
polling).
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-07-03 12:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 22:34 [PATCH 1/4] iopoll: Generalize read_poll_timeout() into poll_timeout_us() Ville Syrjala
2025-07-02 22:34 ` [PATCH 2/4] iopoll: Avoid evaluating 'cond' twice in poll_timeout_us() Ville Syrjala
2025-07-03 11:55 ` Jani Nikula
2025-07-02 22:34 ` [PATCH 3/4] iopoll: Reorder the timeout handling " Ville Syrjala
2025-07-03 12:00 ` Jani Nikula
2025-07-02 22:34 ` [PATCH 4/4] DO-NOT-MERGE: drm/i915: Use poll_timeout_us() Ville Syrjala
2025-07-03 12:12 ` Jani Nikula
2025-07-03 12:50 ` Ville Syrjälä [this message]
2025-07-03 0:05 ` ✓ i915.CI.BAT: success for series starting with [1/4] iopoll: Generalize read_poll_timeout() into poll_timeout_us() Patchwork
2025-07-03 8:56 ` ✓ i915.CI.Full: " Patchwork
2025-07-03 11:51 ` [PATCH 1/4] " Jani Nikula
2025-07-03 14:28 ` Lucas De Marchi
2025-07-04 8:40 ` Jani Nikula
2025-07-08 13:16 ` [PATCH v2 " Ville Syrjala
2025-07-15 18:20 ` Ville Syrjälä
2025-07-31 8:51 ` Jani Nikula
2025-08-26 10:56 ` Jani Nikula
2025-07-08 18:04 ` ✓ i915.CI.BAT: success for series starting with [v2,1/4] iopoll: Generalize read_poll_timeout() into poll_timeout_us() (rev2) Patchwork
2025-07-08 23:14 ` ✓ i915.CI.Full: " Patchwork
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=aGZ8s2mQCmvYK7w1@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=david.laight.linux@gmail.com \
--cc=dibin.moolakadan.subrahmanian@intel.com \
--cc=geert+renesas@glider.be \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=mattw@codeaurora.org \
--cc=zhengdejin5@gmail.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).