From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
Jani Nikula <jani.nikula@linux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Tvrtko Ursulin <tursulin@ursulin.net>
Subject: Re: [PATCH v3 0/8] drm/i915: PREEMPT_RT related fixups.
Date: Fri, 4 Oct 2024 11:31:22 +0300 [thread overview]
Message-ID: <Zv-n2h0gsquKOvXu@intel.com> (raw)
In-Reply-To: <20241004064951.XLw7TFbS@linutronix.de>
On Fri, Oct 04, 2024 at 08:49:51AM +0200, Sebastian Andrzej Siewior wrote:
> On 2024-10-02 19:58:08 [+0300], Ville Syrjälä wrote:
> > > These patches were not picked. Did I forget something or was this just
> > > overseen?
> >
> > This looks quite poorly justified. Eg. you seem to be now
> > leaving interrupts enabled (and even preemption enabled I
> > guess) when we're racing against the raster beam. On first
> > blush that seems like a recipe for failure.
>
> I can't really parse this. I may leave interrupts enabled in vblanc code
> (the first two patches).
vblank evasion 101:
We need to write a boatload of registers atomically within one
frame. We try to guarantee that by checking if we're too close
the point at which the hardware latches said registers, and if
so we defer the update into the next frame.
raster scan/time ->
.....vertical active.........><...vertical blank...><...vertical active...><...vertical blank
<VBLANK_EVASION_TIME_US> ^^ ^
^ || |
| registers are /| registers are /
| latched here | latched here
| |
If we're somewhere |
in here we delay |
writing the registers... ...until we are about here and then we have most
of the frame to write all the registers. Though
since we use an interrupt to wait for this point
interrupt latency does eat into the budget a bit
.....vertical active.........><..vertical blank...><...
<VBLANK_EVASION_TIME_US> ^
<-. |
| registers are /
| latched here
|
If we're somewhere to the left of this
point we proceed to write the registers
immediately and now in the worst case we
have exactly VBLANK_EVASION_TIME_US to
write all the registers
So once vblank evasion has declared things to be safe we might have
as short a time as VBLANK_EVASION_TIME_US to write all the registers.
If the CPU gets stolen from us at that point we can no longer guarantee
anything. The magic value has been tuned empirically over the years,
until we've found something that seems to work well enough, without
being too long to negatively affect performance.
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2024-10-04 8:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 12:57 [PATCH v3 0/8] drm/i915: PREEMPT_RT related fixups Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 1/8] drm/i915: Use preempt_disable/enable_rt() where recommended Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 2/8] drm/i915: Don't disable interrupts on PREEMPT_RT during atomic updates Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 3/8] drm/i915: Don't check for atomic context on PREEMPT_RT Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 4/8] drm/i915: Disable tracing points " Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 5/8] drm/i915/gt: Use spin_lock_irq() instead of local_irq_disable() + spin_lock() Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 6/8] drm/i915: Drop the irqs_disabled() check Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 7/8] drm/i915/guc: Consider also RCU depth in busy loop Sebastian Andrzej Siewior
2024-06-28 12:58 ` [PATCH v3 8/8] Revert "drm/i915: Depend on !PREEMPT_RT." Sebastian Andrzej Siewior
2024-06-28 13:35 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: PREEMPT_RT related fixups. (rev12) Patchwork
2024-06-28 13:35 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-06-28 13:43 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-06-28 14:03 ` Saarinen, Jani
2024-10-02 16:25 ` [PATCH v3 0/8] drm/i915: PREEMPT_RT related fixups Sebastian Andrzej Siewior
2024-10-02 16:58 ` Ville Syrjälä
2024-10-04 6:49 ` Sebastian Andrzej Siewior
2024-10-04 8:31 ` Ville Syrjälä [this message]
2024-10-04 8:45 ` Sebastian Andrzej Siewior
2024-10-04 9:07 ` Ville Syrjälä
2024-10-04 10:44 ` Sebastian Andrzej Siewior
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=Zv-n2h0gsquKOvXu@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=bigeasy@linutronix.de \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tglx@linutronix.de \
--cc=tursulin@ursulin.net \
/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