From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/6] drm/i915: Track pages pinned due to swizzling quirk
Date: Tue, 1 Nov 2016 08:52:57 +0000 [thread overview]
Message-ID: <be00bad2-1dc9-5cc4-7649-997aaaa68804@linux.intel.com> (raw)
In-Reply-To: <20161101084811.GJ30109@nuc-i3427.alporthouse.com>
On 01/11/2016 08:48, Chris Wilson wrote:
> On Tue, Nov 01, 2016 at 08:39:14AM +0000, Tvrtko Ursulin wrote:
>>
>> On 31/10/2016 10:26, Chris Wilson wrote:
>>> If we have a tiled object and an unknown CPU swizzle pattern, we pin the
>>> pages to prevent the object from being swapped out (and us corrupting
>>> the contents as we do not know the access pattern and so cannot convert
>>> it to linear and back to tiled on reuse). This requires us to remember
>>> to drop the extra pinning when freeing the object, or else we trigger
>>> warnings about the pin leak. In commit fbbd37b36fa5 ("drm/i915: Move
>>> object release to a freelist + worker"), the object free path was
>>> deferred to a work, but the unpinning of the quirk, along with marking
>>> the object as reclaimable, was left on the immediate path (so that if
>>> required we could reclaim the pages under memory pressure as early as
>>> possible). However, this split introduced a bug where the pages we no
>>> longer being unpinned if they were marked as unneeded.
>>
>> Last sentence is broken.
>
> Almost the right words in the wrong order.
>
>>> if (obj->mm.madv != __I915_MADV_PURGED)
>>> @@ -4335,14 +4342,12 @@ void i915_gem_free_object(struct drm_gem_object *gem_obj)
>>> {
>>> struct drm_i915_gem_object *obj = to_intel_bo(gem_obj);
>>>
>>> + if (obj->mm.quirked)
>>> + __i915_gem_object_unpin_pages(obj);
>>> +
>>> if (discard_backing_storage(obj))
>>> obj->mm.madv = I915_MADV_DONTNEED;
>>>
>>> - if (obj->mm.pages && obj->mm.madv == I915_MADV_WILLNEED &&
>>> - to_i915(obj->base.dev)->quirks & QUIRK_PIN_SWIZZLED_PAGES &&
>>> - i915_gem_object_is_tiled(obj))
>>> - __i915_gem_object_unpin_pages(obj);
>>> -
>>
>> This reordering would not have been enough to fix this?
>
> Yes. I was trying to avoid the repeated if() conditions and thought a
> flag would eliminate a few of them. It only managed to kill this one and
> provide assertions elsewhere.
>
> Still we reduce the 3 [of 4] tests done to one for all devices but some
> odd gen3/gen4 (and gain a sanity check for uncommon code paths).
Okay then, with the commit message fix:
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
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:[~2016-11-01 8:53 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-31 10:26 [PATCH 1/6] drm/i915: Use the full hammer when shutting down the rcu tasks Chris Wilson
2016-10-31 10:26 ` [PATCH 2/6] drm/i915: Avoid accessing request->timeline outside of its lifetime Chris Wilson
2016-10-31 17:35 ` Tvrtko Ursulin
2016-10-31 21:03 ` Chris Wilson
2016-11-01 8:43 ` Tvrtko Ursulin
2016-10-31 10:26 ` [PATCH 3/6] drm/i915: Track pages pinned due to swizzling quirk Chris Wilson
2016-11-01 8:39 ` Tvrtko Ursulin
2016-11-01 8:48 ` Chris Wilson
2016-11-01 8:52 ` Tvrtko Ursulin [this message]
2016-10-31 10:26 ` [PATCH 4/6] drm/i915: Discard objects from mm global_list after being shrunk Chris Wilson
2016-11-01 8:29 ` Tvrtko Ursulin
2016-10-31 10:26 ` [PATCH 5/6] drm/i915: Move the recently scanned objects to the tail after shrinking Chris Wilson
2016-10-31 15:26 ` Joonas Lahtinen
2016-10-31 10:26 ` [PATCH 6/6] drm/i915: Store the vma in an rbtree under the object Chris Wilson
2016-11-01 8:41 ` Tvrtko Ursulin
2016-11-01 8:50 ` Chris Wilson
2016-11-01 8:54 ` Tvrtko Ursulin
2016-11-01 9:06 ` Chris Wilson
2016-11-01 9:20 ` Tvrtko Ursulin
2016-11-01 9:45 ` Chris Wilson
2016-11-01 9:43 ` Tvrtko Ursulin
2016-11-01 9:56 ` Chris Wilson
2016-10-31 11:16 ` ✗ Fi.CI.BAT: failure for series starting with [1/6] drm/i915: Use the full hammer when shutting down the rcu tasks Patchwork
2016-10-31 17:15 ` [PATCH 1/6] " Tvrtko Ursulin
2016-10-31 21:05 ` 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=be00bad2-1dc9-5cc4-7649-997aaaa68804@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 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.