From: Dave Gordon <david.s.gordon@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 06/17] drm/i915: Move obj->dirty:1 to obj->flags
Date: Tue, 6 Sep 2016 12:37:33 +0100 [thread overview]
Message-ID: <b25df636-e90f-9f48-eabd-c96163588e11@intel.com> (raw)
In-Reply-To: <20160822080350.4964-7-chris@chris-wilson.co.uk>
On 22/08/16 09:03, Chris Wilson wrote:
> The obj->dirty bit is a companion to the obj->active bits that were
> moved to the obj->flags bitmask. Since we also update this bit inside
> the i915_vma_move_to_active() hotpath, we can aide gcc by also moving
> the obj->dirty bit to obj->flags bitmask.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 2 +-
> drivers/gpu/drm/i915/i915_drv.h | 22 +++++++++++++++++++++-
> drivers/gpu/drm/i915/i915_gem.c | 20 ++++++++++----------
> drivers/gpu/drm/i915/i915_gem_execbuffer.c | 3 +--
> drivers/gpu/drm/i915/i915_gem_userptr.c | 6 +++---
> drivers/gpu/drm/i915/i915_gpu_error.c | 2 +-
> drivers/gpu/drm/i915/intel_lrc.c | 6 +++---
> 7 files changed, 40 insertions(+), 21 deletions(-)
>
[snip]
> @@ -3272,7 +3272,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
> if (write) {
> obj->base.read_domains = I915_GEM_DOMAIN_GTT;
> obj->base.write_domain = I915_GEM_DOMAIN_GTT;
> - obj->dirty = 1;
> + i915_gem_object_set_dirty(obj);
At this point the object is or may not be pinned. From our conversation
back in April ...
>> What I particularly dislike about the current obj->dirty is that it is
>> strictly only valid inside a pin_pages/unpin_pages section. That isn't
>> clear from the API atm.
>> -Chris
>
> So, I tried replacing all instances of "obj->dirty = true" with my
> newfunction i915_gem_object_mark_dirty(), and added an assertion that
> it's called only when (pages_pin_count > 0) - and found a failure.
>
> Stack is:
> i915_gem_object_mark_dirty
> i915_gem_object_set_to_gtt_domain
> i915_gem_set_domain_ioctl
>
> So is i915_gem_object_set_to_gtt_domain() wrong? It's done a
> get_pages but no pin_pages.
... and the same issue is still there. I think I worked out a
hypothetical scenario where this would lead to data corruption:
* set to GTT => mark dirty
* BO paged out => flushed to swap, marked clean
* BO paged in => still clean
* update contents => still clean?
* get paged out => not written out?
But can this actually happen?
.Dave.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-09-06 11:37 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-22 8:03 Execbuf fixes and major tuning Chris Wilson
2016-08-22 8:03 ` [PATCH 01/17] drm/i915: Skip holding an object reference for execbuf preparation Chris Wilson
2016-08-22 11:21 ` Joonas Lahtinen
2016-08-22 11:56 ` Chris Wilson
2016-08-22 8:03 ` [PATCH 02/17] drm/i915: Defer active reference until required Chris Wilson
2016-08-22 8:03 ` [PATCH 03/17] drm/i915: Allow the user to pass a context to any ring Chris Wilson
2016-08-22 11:23 ` Joonas Lahtinen
2016-08-22 12:23 ` Chris Wilson
2016-08-23 13:28 ` John Harrison
2016-08-23 13:33 ` John Harrison
2016-08-25 15:28 ` John Harrison
2016-08-29 12:21 ` Joonas Lahtinen
2016-08-22 8:03 ` [PATCH 04/17] drm/i915: Fix i915_gem_evict_for_vma (soft-pinning) Chris Wilson
2016-08-22 8:03 ` [PATCH 05/17] drm/i915: Pin the pages whilst operating on them Chris Wilson
2016-08-23 11:54 ` Joonas Lahtinen
2016-08-22 8:03 ` [PATCH 06/17] drm/i915: Move obj->dirty:1 to obj->flags Chris Wilson
2016-08-23 12:01 ` Joonas Lahtinen
2016-09-06 11:37 ` Dave Gordon [this message]
2016-09-06 13:16 ` Chris Wilson
2016-08-22 8:03 ` [PATCH 07/17] drm/i915: Use the precomputed value for whether to enable command parsing Chris Wilson
2016-08-24 14:33 ` John Harrison
2016-08-27 9:12 ` Chris Wilson
2016-08-22 8:03 ` [PATCH 08/17] drm/i915: Drop spinlocks around adding to the client request list Chris Wilson
2016-08-24 13:16 ` Mika Kuoppala
2016-08-24 13:25 ` Chris Wilson
2016-08-26 9:13 ` Mika Kuoppala
2016-09-02 10:30 ` John Harrison
2016-09-02 10:59 ` Chris Wilson
2016-09-02 11:02 ` Chris Wilson
2016-09-02 13:20 ` John Harrison
2016-09-02 13:38 ` Chris Wilson
2016-08-22 8:03 ` [PATCH 09/17] drm/i915: Amalgamate execbuffer parameter structures Chris Wilson
2016-08-24 13:20 ` John Harrison
2016-08-22 8:03 ` [PATCH 10/17] drm/i915: Use vma->exec_entry as our double-entry placeholder Chris Wilson
2016-08-22 8:03 ` [PATCH 11/17] drm/i915: Store a direct lookup from object handle to vma Chris Wilson
2016-08-22 8:03 ` [PATCH 12/17] drm/i915: Pass vma to relocate entry Chris Wilson
2016-08-22 8:03 ` [PATCH 13/17] drm/i915: Eliminate lots of iterations over the execobjects array Chris Wilson
2016-08-25 6:03 ` [PATCH v2] " Chris Wilson
2016-08-22 8:03 ` [PATCH 14/17] drm/i915: First try the previous execbuffer location Chris Wilson
2016-08-22 8:03 ` [PATCH 15/17] drm/i915: Wait upon userptr get-user-pages within execbuffer Chris Wilson
2016-08-23 10:53 ` Joonas Lahtinen
2016-08-23 11:14 ` Chris Wilson
2016-08-22 8:03 ` [PATCH 16/17] drm/i915: Remove superfluous i915_add_request_no_flush() helper Chris Wilson
2016-08-23 10:21 ` Joonas Lahtinen
2016-08-22 8:03 ` [PATCH 17/17] drm/i915: Use the MRU stack search after evicting Chris Wilson
2016-08-23 13:52 ` ✗ Fi.CI.BAT: failure for series starting with [01/17] drm/i915: Skip holding an object reference for execbuf preparation Patchwork
2016-08-25 6:51 ` ✗ Fi.CI.BAT: warning for series starting with [01/17] drm/i915: Skip holding an object reference for execbuf preparation (rev2) 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=b25df636-e90f-9f48-eabd-c96163588e11@intel.com \
--to=david.s.gordon@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.