public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>,
	Michel Thierry <michel.thierry@intel.com>
Subject: Re: [PATCH] drm/i915: Ensure associated VMAs are inactive when contexts are destroyed
Date: Tue, 3 Nov 2015 11:08:49 +0000	[thread overview]
Message-ID: <563895C1.4090708@linux.intel.com> (raw)
In-Reply-To: <20151103105524.GB669@nuc-i3427.alporthouse.com>


On 03/11/15 10:55, Chris Wilson wrote:
> On Mon, Oct 26, 2015 at 01:10:19PM +0000, Tvrtko Ursulin wrote:
>>
>> On 26/10/15 12:10, Chris Wilson wrote:
>>> On Mon, Oct 26, 2015 at 12:00:06PM +0000, Tvrtko Ursulin wrote:
>>>>
>>>> On 26/10/15 11:23, Chris Wilson wrote:
>>>>> On Mon, Oct 26, 2015 at 11:05:03AM +0000, Tvrtko Ursulin wrote:
>>>>>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>>>>
>>>>>> In the following commit:
>>>>>>
>>>>>>       commit e9f24d5fb7cf3628b195b18ff3ac4e37937ceeae
>>>>>>       Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>>>>>       Date:   Mon Oct 5 13:26:36 2015 +0100
>>>>>>
>>>>>>           drm/i915: Clean up associated VMAs on context destruction
>>>>>>
>>>>>> I added a WARN_ON assertion that VM's active list must be empty
>>>>>> at the time of owning context is getting freed, but that turned
>>>>>> out to be a wrong assumption.
>>>>>>
>>>>>> Due ordering of operations in i915_gem_object_retire__read, where
>>>>>> contexts are unreferenced before VMAs are moved to the inactive
>>>>>> list, the described situation can in fact happen.
>>>>>
>>>>> The context is being unreferenced indirectly. Adding a direct reference
>>>>> here is even more bizarre.
>>>>
>>>> Perhaps is not the prettiest, but it sounds logical to me to ensure
>>>> that order of destruction of involved object hierarchy goes from the
>>>> bottom-up and is not interleaved.
>>>>
>>>> If you consider the active/inactive list position as part of the
>>>> retire process, doing it at the very place in code, and the very
>>>> object that looked to be destroyed out of sequence, to me sounded
>>>> logical.
>>>>
>>>> How would you do it, can you think of a better way?
>>>
>>> The reference is via the request. We are handling requests, it makes
>>> more sense that you take the reference on the request.
>>
>> Hm, so you would be happy with:
>
> Go up another level. There is just one callsite where the reference
> needs to be added across the call.

i915_gem_retire_requests_ring? Why do you think that is more logical?

To me it sounds really clean to do it in the place which deals with 
moving VMAs to the inactive list. It is localized and clear then - that 
it is fixing the illogic of allowing context destructor to run with VMAs 
still on the active list.

> And no, I would not be happy as I see this as just futher increasing the
> technical debt.

I thought we have agreed it is better to fix up what we have quickly, to 
the extent it is feasible, and work towards the rewrite over time.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-11-03 11:08 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 11:05 [PATCH] drm/i915: Ensure associated VMAs are inactive when contexts are destroyed Tvrtko Ursulin
2015-10-26 11:23 ` Chris Wilson
2015-10-26 12:00   ` Tvrtko Ursulin
2015-10-26 12:10     ` Chris Wilson
2015-10-26 13:10       ` Tvrtko Ursulin
2015-11-03 10:48         ` Tvrtko Ursulin
2015-11-03 10:55         ` Chris Wilson
2015-11-03 11:08           ` Tvrtko Ursulin [this message]
2015-11-17 15:53             ` [PATCH v2] " Tvrtko Ursulin
2015-11-17 16:04               ` Chris Wilson
2015-11-17 16:27                 ` [PATCH v3] " Tvrtko Ursulin
2015-11-17 16:39                   ` Daniel Vetter
2015-11-17 16:54                     ` Tvrtko Ursulin
2015-11-17 17:08                       ` Daniel Vetter
2015-11-17 17:24                         ` Tvrtko Ursulin
2015-11-17 17:32                           ` Tvrtko Ursulin
2015-11-17 17:34                             ` Tvrtko Ursulin
2015-11-17 17:56                           ` Daniel Vetter
2015-11-18 17:18                             ` Tvrtko Ursulin
2015-11-19  9:17                               ` Daniel Vetter
2015-11-19  9:42                                 ` Tvrtko Ursulin
2015-11-19 12:13                                   ` Daniel Vetter
2015-11-19 12:28                                     ` Tvrtko Ursulin

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=563895C1.4090708@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=michel.thierry@intel.com \
    --cc=tvrtko.ursulin@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