From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 2/3] drm/i915: Split breadcrumbs spinlock into two
Date: Fri, 03 Mar 2017 19:50:01 +0200 [thread overview]
Message-ID: <87mvd2z1va.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170303173750.GH5997@nuc-i3427.alporthouse.com>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> On Fri, Mar 03, 2017 at 07:26:34PM +0200, Mika Kuoppala wrote:
>> Chris Wilson <chris@chris-wilson.co.uk> writes:
>> > @@ -768,7 +776,7 @@ void intel_engine_reset_breadcrumbs(struct intel_engine_cs *engine)
>> > struct intel_breadcrumbs *b = &engine->breadcrumbs;
>> >
>> > cancel_fake_irq(engine);
>> > - spin_lock_irq(&b->lock);
>> > + spin_lock_irq(&b->irq_lock);
>>
>> In here I was thinking that you want both locks help, but
>> then can't find a reason why. Perhaps just to ensure that
>> the wait tree stays still.
>
> Right, here we are just rearming the irq, so I didn't think taking the
> rb_lock helped with clarity. (Just the opposite, this showed nicely the
> divison in labour between the locks :)
>
>> > if (b->irq_enabled)
>> > irq_enable(engine);
>> > @@ -787,7 +795,7 @@ void intel_engine_reset_breadcrumbs(struct intel_engine_cs *engine)
>> > if (b->irq_armed)
>> > enable_fake_irq(b);
>> >
>> > - spin_unlock_irq(&b->lock);
>> > + spin_unlock_irq(&b->irq_lock);
>> > }
>> >
>> > void intel_engine_fini_breadcrumbs(struct intel_engine_cs *engine)
>> > @@ -811,7 +819,7 @@ bool intel_breadcrumbs_busy(struct intel_engine_cs *engine)
>> > struct intel_breadcrumbs *b = &engine->breadcrumbs;
>> > bool busy = false;
>> >
>> > - spin_lock_irq(&b->lock);
>> > + spin_lock_irq(&b->rb_lock);
>>
>> Wrong lock taken and relased in this function?
>
> Here we can simply take the outer rb_lock, as that guarantees the rbtree
> won't change and therefore also the first_wait/irq_wait cannot be
> lost.
Applied and indeed the first_wait is always modified by under rb_lock.
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-03-03 17:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 12:17 [PATCH v2 1/3] drm/i915: Refactor wakeup of the next breadcrumb waiter Chris Wilson
2017-03-03 12:17 ` [PATCH v2 2/3] drm/i915: Split breadcrumbs spinlock into two Chris Wilson
2017-03-03 17:26 ` Mika Kuoppala
2017-03-03 17:37 ` Chris Wilson
2017-03-03 17:50 ` Mika Kuoppala [this message]
2017-03-03 12:17 ` [PATCH v2 3/3] drm/i915: Only wake the waiter from the interrupt if passed Chris Wilson
2017-03-03 17:57 ` Mika Kuoppala
2017-03-03 18:12 ` Chris Wilson
2017-03-03 12:48 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/3] drm/i915: Refactor wakeup of the next breadcrumb waiter Patchwork
2017-03-03 14:07 ` [PATCH v2 1/3] " Chris Wilson
2017-03-03 16:19 ` Mika Kuoppala
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=87mvd2z1va.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.