Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tursulin@ursulin.net>
To: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>,
	intel-gfx@lists.freedesktop.org, vinay.belgaumkar@intel.com
Cc: dev@lankhorst.se
Subject: Re: [PATCH 1/3] drm/i915/pmu: Disable on PREEMPT_RT
Date: Wed, 30 Sep 2026 09:02:14 +0100	[thread overview]
Message-ID: <83bc37f9-e5b5-41de-a03b-6de01966ffe6@ursulin.net> (raw)
In-Reply-To: <20260929190147.2886670-6-umesh.nerlige.ramappa@intel.com>


On 29/09/2026 20:01, Umesh Nerlige Ramappa wrote:
> From: Maarten Lankhorst <dev@lankhorst.se>
> 
> I tried to come up with alternative and lockless approaches
> to make pmu work, but since the perf events are run in
> atomic context on PREEMPT_RT, ordinary spinlocks no longer
> work and forcewake and register accesses become problematic.

If it is only those events put the checks into config_status and 
engine_event_status respectively. That will allow the non-problematic 
events to work.

> Disable perf events on PREEMPT_RT for now, without affecting
> !PREEMPT_RT users.
> 
> Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
> ---
> v2: s/reeturn/return/
> ---
>   drivers/gpu/drm/i915/i915_pmu.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
> index 1c3bafda9c70..9ea5626399e5 100644
> --- a/drivers/gpu/drm/i915/i915_pmu.c
> +++ b/drivers/gpu/drm/i915/i915_pmu.c
> @@ -1156,6 +1156,16 @@ void i915_pmu_register(struct drm_i915_private *i915)
>   	};
>   	int ret = -ENOMEM;
>   
> +	/*
> +	 * PREEMPT_RT has problems with forcewake. Forcewake is used by the
> +	 * engine 'busy' event when guc submission is enabled, and to measure
> +	 * rc6 residency.
> +	 *
> +	 * Disable pmu events on PREEMPT_RT entirely to prevent deadlocks.
> +	 */
> +	if (IS_ENABLED(CONFIG_PREEMPT_RT))
> +		return;

It would be nice to emit a suitable drm_notice here, equivalent to how 
the existing error path does if the registration unexpectedly fails.

Regards,

Tvrtko

> +
>   	spin_lock_init(&pmu->lock);
>   	hrtimer_setup(&pmu->timer, i915_sample, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>   	init_rc6(pmu);


  parent reply	other threads:[~2026-09-30  8:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29 19:01 [PATCH 0/3] Fixup deadlock scenarios in the PMU path Umesh Nerlige Ramappa
2026-09-29 19:01 ` [PATCH 1/3] drm/i915/pmu: Disable on PREEMPT_RT Umesh Nerlige Ramappa
2026-09-30  5:42   ` Maarten Lankhorst
2026-09-30  8:02   ` Tvrtko Ursulin [this message]
2026-09-30 13:25     ` Maarten Lankhorst
2026-10-01 12:15       ` Tvrtko Ursulin
2026-09-29 19:01 ` [PATCH 2/3] drm/i915/guc: Use a delayed wakeref put in guc_engine_busyness() Umesh Nerlige Ramappa
2026-09-29 19:01 ` [PATCH 3/3] drm/i915/pmu: Use a delayed wakeref put in get_rc6() Umesh Nerlige Ramappa
2026-09-29 21:35 ` ✓ i915.CI.BAT: success for Fixup deadlock scenarios in the PMU path (rev2) Patchwork
2026-09-30  7:26 ` ✗ i915.CI.Full: failure " 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=83bc37f9-e5b5-41de-a03b-6de01966ffe6@ursulin.net \
    --to=tursulin@ursulin.net \
    --cc=dev@lankhorst.se \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=umesh.nerlige.ramappa@intel.com \
    --cc=vinay.belgaumkar@intel.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