From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 07/27] drm/i915: Coordinate i915_active with its own mutex
Date: Fri, 27 Sep 2019 14:58:24 +0100 [thread overview]
Message-ID: <87d8e012-37f2-1c42-e855-d647153cb525@linux.intel.com> (raw)
In-Reply-To: <156958754666.32596.2846806960936006960@skylake-alporthouse-com>
On 27/09/2019 13:32, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-09-27 13:25:23)
>>
>> On 27/09/2019 13:16, Chris Wilson wrote:
>>> Quoting Tvrtko Ursulin (2019-09-27 13:08:51)
>>>>
>>>> On 27/09/2019 12:25, Chris Wilson wrote:
>>>>> Quoting Tvrtko Ursulin (2019-09-27 12:10:29)
>>>>>>
>>>>>> On 25/09/2019 11:01, Chris Wilson wrote:
>>>>>>> +struct dma_fence *
>>>>>>> +__i915_active_fence_set(struct i915_active_fence *active,
>>>>>>> + struct dma_fence *fence)
>>>>>>
>>>>>> Can you add a short comment for this function explaining the racyness
>>>>>> and so why it returns prev and what should the callers do with it?
>>>>>
>>>>> Before using this function, we had the callers declare what mutex guards
>>>>> this timeline and we check here that is held.
>>>>
>>>> No, I mean because it has to reload prev and return it to the caller,
>>>> which implies that is to handle some designed-in racy-ness which I think
>>>> should be mentioned.
>>>
>>> But that's not racing with the caller, that just racing with the
>>> callback from the interrupt handler and the reason why we have to check
>>> after serialising is called out. /* serialise with prev->cb_list */ ?
>>>
>>> The caller is responsible for ensuring that prev is executed before
>>> fence to keep the timeline in the same order as recorded.
>>
>> I did not say it is racing with the caller, but that the caller has to
>> handle a race.
>
> But the caller only has to care about "was there already an active fence
> on this timeline? If so, I must make sure it executes before me and take
> that into consideration for the flow along the timeline"
>
> I'm not seeing what race the caller has to be concerned with here. If
> they replace the last request in the timeline, they have it returned.
> If there was no request previously in the timeline, they have NULL.
> (That just seems straightforward.)
>
>> "Serialise with prev->cb_list" is too low level for me. Trust me, I
>> always struggle with the active tracking code since there is so many
>> indirections and relationships. So in the absence of a visual diagram a
>> higher level comment would be beneficial for the future self. Just
>> expanding on what you replied here talking about how interrupts
>> interacts with new stuff entering tracking would do it.
>
> It's just about that the callback may be executing and so we need to
> serialise the list manipulation under the lock; having performed that
> list manipulation, we then know whether or not we were successful in
> capturing the previous fence.
Ok ok :), just expand the comment next to re-fetch of prev =
active->fence to that effect, that's all I'm asking. :)
It will make it easier for future reader to understand why it is
required and under what circumstances could active->fence have became
NULL in there.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-09-27 13:58 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 10:01 struct_mutex is over the hill and far away Chris Wilson
2019-09-25 10:01 ` [PATCH 01/27] dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling) Chris Wilson
2019-09-25 10:01 ` [PATCH 02/27] drm/mm: Pack allocated/scanned boolean into a bitfield Chris Wilson
2019-09-25 10:01 ` [PATCH 03/27] drm/i915: Only track bound elements of the GTT Chris Wilson
2019-09-25 10:01 ` [PATCH 04/27] drm/i915: Mark up address spaces that may need to allocate Chris Wilson
2019-09-25 10:01 ` [PATCH 05/27] drm/i915: Pull i915_vma_pin under the vm->mutex Chris Wilson
2019-09-27 8:47 ` Tvrtko Ursulin
2019-09-27 11:06 ` Chris Wilson
2019-09-25 10:01 ` [PATCH 06/27] drm/i915: Push the i915_active.retire into a worker Chris Wilson
2019-09-25 10:01 ` [PATCH 07/27] drm/i915: Coordinate i915_active with its own mutex Chris Wilson
2019-09-27 11:10 ` Tvrtko Ursulin
2019-09-27 11:25 ` Chris Wilson
2019-09-27 12:08 ` Tvrtko Ursulin
2019-09-27 12:16 ` Chris Wilson
2019-09-27 12:25 ` Tvrtko Ursulin
2019-09-27 12:32 ` Chris Wilson
2019-09-27 13:58 ` Tvrtko Ursulin [this message]
2019-09-27 14:10 ` Chris Wilson
2019-09-25 10:01 ` [PATCH 08/27] drm/i915: Move idle barrier cleanup into engine-pm Chris Wilson
2019-09-25 10:01 ` [PATCH 09/27] drm/i915: Drop struct_mutex from around i915_retire_requests() Chris Wilson
2019-09-25 10:01 ` [PATCH 10/27] drm/i915: Remove the GEM idle worker Chris Wilson
2019-09-25 10:01 ` [PATCH 11/27] drm/i915: Merge wait_for_timelines with retire_request Chris Wilson
2019-09-25 10:47 ` Tvrtko Ursulin
2019-09-25 10:54 ` Chris Wilson
2019-09-25 10:01 ` [PATCH 12/27] drm/i915: Move request runtime management onto gt Chris Wilson
2019-09-25 10:57 ` Tvrtko Ursulin
2019-09-25 11:17 ` Chris Wilson
2019-09-25 11:24 ` Chris Wilson
2019-09-25 11:29 ` Chris Wilson
2019-09-25 11:33 ` Chris Wilson
2019-09-25 15:17 ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 13/27] drm/i915: Move global activity tracking from GEM to GT Chris Wilson
2019-09-25 10:01 ` [PATCH 14/27] drm/i915: Expose engine properties via sysfs Chris Wilson
2019-09-27 20:48 ` Rodrigo Vivi
2019-09-25 10:01 ` [PATCH 15/27] drm/i915/execlists: Force preemption Chris Wilson
2019-09-25 10:01 ` [PATCH 16/27] drm/i915: Mark up "sentinel" requests Chris Wilson
2019-09-25 10:01 ` [PATCH 17/27] drm/i915/execlists: Cancel banned contexts on schedule-out Chris Wilson
2019-09-25 10:01 ` [PATCH 18/27] drm/i915: Cancel non-persistent contexts on close Chris Wilson
2019-09-25 10:01 ` [PATCH 19/27] drm/i915: Replace hangcheck by heartbeats Chris Wilson
2019-09-27 8:26 ` Joonas Lahtinen
2019-09-27 9:18 ` Chris Wilson
2019-09-25 10:01 ` [PATCH 20/27] drm/i915: Remove logical HW ID Chris Wilson
2019-09-25 12:41 ` Tvrtko Ursulin
2019-09-25 12:51 ` Chris Wilson
2019-09-25 14:38 ` Tvrtko Ursulin
2019-09-25 17:59 ` Daniele Ceraolo Spurio
2019-09-25 18:23 ` Matthew Brost
2019-09-25 10:01 ` [PATCH 21/27] drm/i915: Move context management under GEM Chris Wilson
2019-09-26 13:57 ` Tvrtko Ursulin
2019-10-02 16:09 ` Tvrtko Ursulin
2019-10-03 7:35 ` Chris Wilson
2019-09-25 10:01 ` [PATCH 22/27] drm/i915/overlay: Drop struct_mutex guard Chris Wilson
2019-09-25 12:43 ` Tvrtko Ursulin
2019-09-25 12:53 ` Chris Wilson
2019-09-25 13:01 ` Tvrtko Ursulin
2019-09-25 13:11 ` Chris Wilson
2019-09-25 10:01 ` [PATCH 23/27] drm/i915: Drop struct_mutex guard from debugfs/framebuffer_info Chris Wilson
2019-09-25 12:45 ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 24/27] drm/i915: Remove struct_mutex guard for debugfs/opregion Chris Wilson
2019-09-25 12:51 ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 25/27] drm/i915: Drop struct_mutex from suspend state save/restore Chris Wilson
2019-09-25 12:52 ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 26/27] drm/i915/selftests: Drop vestigal struct_mutex guards Chris Wilson
2019-09-25 12:55 ` Tvrtko Ursulin
2019-09-25 10:01 ` [PATCH 27/27] drm/i915: Drop struct_mutex from around GEM initialisation Chris Wilson
2019-09-25 12:56 ` Tvrtko Ursulin
2019-09-25 10:21 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/27] dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling) Patchwork
2019-09-25 10:34 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-09-25 10:51 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-26 0:56 ` ✗ Fi.CI.IGT: 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=87d8e012-37f2-1c42-e855-d647153cb525@linux.intel.com \
--to=tvrtko.ursulin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox