From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/18] drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe
Date: Mon, 19 Aug 2019 14:31:21 +0300 [thread overview]
Message-ID: <87a7c55r3q.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <156620549366.30002.3962015031126643907@skylake-alporthouse-com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Quoting Mika Kuoppala (2019-08-19 09:43:29)
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>>
>> > We use a fake timeline->mutex lock to reassure lockdep that the timeline
>> > is always locked when emitting requests. However, the use inside
>> > __engine_park() may be inside hardirq and so lockdep now complains about
>> > the mixed irq-state of the nested locked. Disable irqs around the
>> > lockdep tracking to keep it happy.
>> >
>> > Fixes: 6c69a45445af ("drm/i915/gt: Mark context->active_count as protected by timeline->mutex")
>> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> > Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> > ---
>> > drivers/gpu/drm/i915/gt/intel_engine_pm.c | 18 ++++++++++++++++++
>> > 1 file changed, 18 insertions(+)
>> >
>> > diff --git a/drivers/gpu/drm/i915/gt/intel_engine_pm.c b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
>> > index 5f03f7dcad72..5d003751968b 100644
>> > --- a/drivers/gpu/drm/i915/gt/intel_engine_pm.c
>> > +++ b/drivers/gpu/drm/i915/gt/intel_engine_pm.c
>> > @@ -37,9 +37,15 @@ static int __engine_unpark(struct intel_wakeref *wf)
>> > return 0;
>> > }
>> >
>> > +#if IS_ENABLED(CONFIG_LOCKDEP)
>> > +
>> > static inline void __timeline_mark_lock(struct intel_context *ce)
>> > {
>> > + unsigned long flags;
>> > +
>> > + local_irq_save(flags);
>> > mutex_acquire(&ce->timeline->mutex.dep_map, 2, 0, _THIS_IP_);
>> > + local_irq_restore(flags);
>>
>> I am starting to have second thoughts. One could argue that the
>> net effect is on positive side.
>>
>> But we diverge on behaviour now.
>
> Are you worrying about the #if-#else and accidentally sticking more code
> in there?
Just the detail that now with lockdep we change the irq pattern
but now thinking about it more, with this block it should not matter
at all. So could be that my concern is totally bogus.
-Mika
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-08-19 11:32 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 7:58 Lock dropping Chris Wilson
2019-08-19 7:58 ` [PATCH 01/18] drm/i915: Always wrap the ring offset before resetting Chris Wilson
2019-08-19 8:40 ` Mika Kuoppala
2019-08-19 7:58 ` [PATCH 02/18] drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe Chris Wilson
2019-08-19 8:43 ` Mika Kuoppala
2019-08-19 9:04 ` Chris Wilson
2019-08-19 11:31 ` Mika Kuoppala [this message]
2019-08-19 7:58 ` [PATCH 03/18] drm/i915: Use 0 for the unordered context Chris Wilson
2019-08-19 7:58 ` [PATCH 04/18] drm/i915: Only emit the 'send bug report' once for a GPU hang Chris Wilson
2019-08-19 11:29 ` Mika Kuoppala
2019-08-19 11:36 ` Chris Wilson
2019-08-19 7:58 ` [PATCH 05/18] drm/i915: i915_active.retire() is optional Chris Wilson
2019-08-19 14:35 ` Matthew Auld
2019-08-19 7:58 ` [PATCH 06/18] drm/i915: Generalise the clflush dma-worker Chris Wilson
2019-08-19 7:58 ` [PATCH 07/18] drm/i915: Replace PIN_NONFAULT with calls to PIN_NOEVICT Chris Wilson
2019-08-19 7:58 ` [PATCH 08/18] drm/i915: Track ggtt fence reservations under its own mutex Chris Wilson
2019-08-19 7:58 ` [PATCH 09/18] drm/i915: Only track bound elements of the GTT Chris Wilson
2019-08-19 7:58 ` [PATCH 10/18] drm/i915: Pull obj->userfault tracking under the ggtt->mutex Chris Wilson
2019-08-19 7:58 ` [PATCH 11/18] drm/i915: Replace i915_vma_put_fence() Chris Wilson
2019-08-19 7:58 ` [PATCH 12/18] drm/i915: Make shrink/unshrink be atomic Chris Wilson
2019-08-19 7:58 ` [PATCH 13/18] drm/i915: Make i915_vma.flags atomic_t for mutex reduction Chris Wilson
2019-08-19 7:58 ` [PATCH 14/18] drm/i915: Pull i915_vma_pin under the vm->mutex Chris Wilson
2019-08-19 7:58 ` [PATCH 15/18] drm/i915: Push the i915_active.retire into a worker Chris Wilson
2019-08-19 7:58 ` [PATCH 16/18] drm/i915: Coordinate i915_active with its own mutex Chris Wilson
2019-08-19 7:58 ` [PATCH 17/18] drm/i915: Move idle barrier cleanup into engine-pm Chris Wilson
2019-08-19 7:58 ` [PATCH 18/18] drm/i915: Drop struct_mutex from around i915_retire_requests() Chris Wilson
2019-08-19 8:39 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/18] drm/i915: Always wrap the ring offset before resetting Patchwork
2019-08-19 9:15 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-08-19 9:20 ` Chris Wilson
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=87a7c55r3q.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.