Linux-rt-users archive on
 help / color / Atom feed
From: Sebastian Andrzej Siewior <>
To: Clark Williams <>
Subject: Re: [PREEMPT_RT PATCH 2/3] i915: convert all irq_locks spinlocks to raw spinlocks
Date: Tue, 3 Sep 2019 10:03:35 +0200
Message-ID: <> (raw)
In-Reply-To: <>

On 2019-08-19 19:33:18 [-0500], Clark Williams wrote:
> From: Clark Williams <>
> The following structures contain a member named 'irq_lock'.
> These three locks are of type spinlock_t and are used in
> multiple contexts including atomic:
>     struct drm_i915_private
>     struct intel_breadcrumbs
>     strict intel_guc
> Convert them all to be raw_spinlock_t so that lockdep and the lock
> debugging code will be happy.

What is your motivation to make the lock raw?
I did the following:

 void intel_engine_signal_breadcrumbs(struct intel_engine_cs *engine)
-       local_irq_disable();
-       intel_engine_breadcrumbs_irq(engine);
-       local_irq_enable();
+               intel_engine_breadcrumbs_irq(engine);
+       } else {
+               local_irq_disable();
+               intel_engine_breadcrumbs_irq(engine);
+               local_irq_enable();
+       }

and lockdep was quiet (+ ignoring/patching the lockdep-irq-off-asserts).
The local_irq_disable() is here (my interpretation of the situation)
because that function is called from process context while the remaining
callers invoke intel_engine_breadcrumbs_irq() from the interrupt
handler and it acquires irq_lock via a plain spin_lock().  That
local_irq_disable() would be required if everyone did a _irqsave().

I tried to check how much worse the latency gets here but I didn't see
anything in a brief test. What I saw however is that switching to
fullscreen while playing a video gives me ~0.5 to ~2ms latency. This is
has nothing to do with this change, I have to dig deeper… It might be
one of the preempt_disable() section I just noticed.
I would prefer to keep the lock non-raw unless there is actual need for


  reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20  0:33 [PREEMPT_RT PATCH 0/3] i915 fixups for lockdep/lockdebugging Clark Williams
2019-08-20  0:33 ` [PREEMPT_RT PATCH 1/3] i915: do not call lockdep_assert_irqs_disabled() on PREEMPT_RT Clark Williams
2019-09-25 16:47   ` Sebastian Andrzej Siewior
2019-08-20  0:33 ` [PREEMPT_RT PATCH 2/3] i915: convert all irq_locks spinlocks to raw spinlocks Clark Williams
2019-09-03  8:03   ` Sebastian Andrzej Siewior [this message]
2019-09-03 13:09     ` Sebastian Andrzej Siewior
2019-09-16 21:21     ` Sean V Kelley
2019-09-27 12:29       ` Sebastian Andrzej Siewior
     [not found]         ` <>
2019-09-27 15:18           ` Sean V Kelley
2019-08-20  0:33 ` [PREEMPT_RT PATCH 3/3] i915: convert uncore lock to raw spinlock Clark Williams

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-rt-users archive on

Archives are clonable:
	git clone --mirror linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ \
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone