public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	linux-rt-users@vger.kernel.org, intel-gfx@lists.freedesktop.org,
	Debian kernel maintainers <debian-kernel@lists.debian.org>
Subject: Re: PREEMPT_RT vs i915
Date: Wed, 9 Jul 2025 20:30:26 +0300	[thread overview]
Message-ID: <aG6nMhimN1lWKAEP@intel.com> (raw)
In-Reply-To: <7c42fe5a6158445e150e7d63991767e44fc36d3d.camel@decadent.org.uk>

On Tue, Jul 08, 2025 at 09:35:21PM +0200, Ben Hutchings wrote:
> Hi all,
> 
> Debian currently provides non-default kernel packages with the
> PREEMPT_RT patchset applied and enabled.  However, for the Debian 14
> "forky" release the plan is to use only the upstream RT support.
> 
> One result of this is that the i915 driver will not be included in our
> RT kernel package on amd64 because the upstream version lacks the
> patches to make it compatible with PREEMPT_RT.  This was not a surprise
> to us, but may disappoint some of our users (for example see
> <https://bugs.debian.org/1108324>).
> 
> I see that Sebastian submitted the i915 fixes upstream in October 2024.
> If I understand the explanation in
> <https://lore.kernel.org/intel-gfx/Zv-n2h0gsquKOvXu@intel.com/> rightly,
> much of these changes are unsafe because i915 has its own hard timing
> requirement for reprogramming multiple display controller registers
> within a single frame.  Is that still the sticking point?
> 
> It seems like the critical uncore lock is currently held in a lot of
> places and potentially for a long time.

It shouldn't be held for that long. I think it should just be
a raw spinlock.

The only edge case I know is the weird retry hack in
__intel_get_crtc_scanline() which I suspect is just due to PSR
and could potentially be handled in a nicer way by actually
checking the PSR state.

> Would it be practical to split
> this lock into:
> 
> 1. raw spinlock protecting only state needed for the atomic (within-one-
> frame) update

Spinlocks aren't involved in that. It is achieved by racing against
the beam, with interrupts disabled to make it more likely the CPU
wins the race.

> 2. regular spinlock protecting everything in uncore
> 
> or is almost all the uncore state potentially used during an atomic
> update?
> 
> Would it help to offload the atomic updates to a kthread that runs with
> RT priority but still with hard interrupts enabled?

Not sure what another thread would specifically get us, as opposed
to eg. just boosting the priority of the existing thread? But whatever
thread does the work needs to not be interrupted for any significant
amount of time.

The interrupt disabling part I suppose is rather hardware/workload
specific, so hard to say anything general about it.

> 
> Would it make things easier if setting CONFIG_PREEMPT_RT=y limited i915
> to not run on some older hardware?

No. All hardware needs this.

Anyways, all of this is rather academic at this point. Someone
needs to try and see what works, and hammer it hard while doing so
to make sure it doesn't fall over easily.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-07-09 17:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08 19:35 PREEMPT_RT vs i915 Ben Hutchings
2025-07-09 17:30 ` Ville Syrjälä [this message]
2025-07-09 19:44   ` Sebastian Andrzej Siewior
2025-07-09 20:09     ` Ville Syrjälä
2025-07-09 22:04       ` Matthew Brost
2025-07-10  6:30         ` Sebastian Andrzej Siewior
2025-07-10 15:21         ` Ville Syrjälä
2025-07-10 18:04           ` Matthew Brost
2025-07-10 18:15             ` Ville Syrjälä
2025-07-10  4:52       ` Mike Galbraith
2025-07-10 15:50         ` Ville Syrjälä
2025-07-11  2:36           ` Mike Galbraith
2025-07-11  3:33             ` Mike Galbraith
2025-07-11  8:05               ` block: lockdep splat with RT config v6.15+ Mike Galbraith
2025-07-11  8:59                 ` Sebastian Andrzej Siewior
2025-07-11  9:03                   ` Mike Galbraith
2025-07-10  6:41       ` PREEMPT_RT vs i915 Sebastian Andrzej Siewior
2025-07-10 15:04         ` Ville Syrjälä
2025-07-10 15:20           ` Sebastian Andrzej Siewior
2025-07-11 12:35             ` Maarten Lankhorst

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=aG6nMhimN1lWKAEP@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ben@decadent.org.uk \
    --cc=bigeasy@linutronix.de \
    --cc=debian-kernel@lists.debian.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-rt-users@vger.kernel.org \
    /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