[Intel-gfx] [PATCH 2/5] drm/i915: Bump the inactive LRU on set-to-GTT-domain

Eric Anholt eric at anholt.net
Mon Feb 27 19:50:49 CET 2012


On Fri, 24 Feb 2012 21:13:39 +0000, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> Currently, we only bump the LRU of an object when we bind into the GTT
> for a page-fault. As the object may be used many times before its
> mapping is zapped, we do not mark it as active as frequently as we
> should. Userspace should be calling set-to-GTT-domain before each
> pointer deference and so is a good place to perform the LRU bump.

> @@ -2883,6 +2873,7 @@ i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj)
>  int
>  i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
>  {
> +	drm_i915_private_t *dev_priv = obj->base.dev->dev_private;
>  	uint32_t old_write_domain, old_read_domains;
>  	int ret;
>  
> @@ -2923,6 +2914,9 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
>  					    old_read_domains,
>  					    old_write_domain);
>  
> +	/* And bump the LRU for this access */
> +	list_move_tail(&obj->mm_list, &dev_priv->mm.inactive_list);

I don't think you know that !obj->active here.  For example, going to
GTT read of something that was currently active and in the SAMPLER read
domain.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120227/d47cb2f6/attachment.sig>


More information about the Intel-gfx mailing list