[Intel-gfx] [PATCH 1/2] drm/i915: Initialise the obj->rcu head

Mika Kuoppala mika.kuoppala at linux.intel.com
Fri Nov 9 08:40:56 UTC 2018


Chris Wilson <chris at chris-wilson.co.uk> writes:

> Make the rcu_head known to the system, in particular for debugobjects.
> And having declared it for debugobjects, we need to tidy up afterwards.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108691
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_gem.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 5b80b0c14aed..24f126ccf21e 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4739,6 +4739,8 @@ void i915_gem_object_init(struct drm_i915_gem_object *obj,
>  	INIT_LIST_HEAD(&obj->lut_list);
>  	INIT_LIST_HEAD(&obj->batch_pool_link);
>  
> +	init_rcu_head(&obj->rcu);
> +
>  	obj->ops = ops;
>  
>  	reservation_object_init(&obj->__builtin_resv);
> @@ -4941,6 +4943,8 @@ static void __i915_gem_free_objects(struct drm_i915_private *i915,
>  		drm_gem_object_release(&obj->base);
>  		i915_gem_info_remove_obj(i915, obj->base.size);
>  
> +		destroy_rcu_head(&obj->rcu);
> +

It looks like you need to break the union in struct drm_i915_gem_object
for this to work. Or did I get the ordering of events wrong?
-Mika

>  		kfree(obj->bit_17);
>  		i915_gem_object_free(obj);
>  
> -- 
> 2.19.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list