diff mbox

[02/14] drm/i915: Decouple the object from the unbound list before freeing pages

Message ID 1354535352-3506-3-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Dec. 3, 2012, 11:49 a.m. UTC
As we may actually allocate in order to save the physical swizzling bits
during the free, we have to be careful not to trigger the shrinker on
the same object.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Daniel Vetter Dec. 3, 2012, 4:16 p.m. UTC | #1
On Mon, Dec 03, 2012 at 11:49:00AM +0000, Chris Wilson wrote:
> As we may actually allocate in order to save the physical swizzling bits
> during the free, we have to be careful not to trigger the shrinker on
> the same object.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Since this one here smells like a potential OOPS fixer on relevant
machines, I've applied it to 3.8-fixes. Since it's tricky, I'll add a
small comment. Thanks for the patch.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 726bfc2..59202e4 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1700,10 +1700,11 @@ i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
>  	if (obj->pages_pin_count)
>  		return -EBUSY;
>  
> +	list_del(&obj->gtt_list);
> +
>  	ops->put_pages(obj);
>  	obj->pages = NULL;
>  
> -	list_del(&obj->gtt_list);
>  	if (i915_gem_object_is_purgeable(obj))
>  		i915_gem_object_truncate(obj);
>  
> -- 
> 1.7.10.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 726bfc2..59202e4 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1700,10 +1700,11 @@  i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
 	if (obj->pages_pin_count)
 		return -EBUSY;
 
+	list_del(&obj->gtt_list);
+
 	ops->put_pages(obj);
 	obj->pages = NULL;
 
-	list_del(&obj->gtt_list);
 	if (i915_gem_object_is_purgeable(obj))
 		i915_gem_object_truncate(obj);