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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Mika Kuoppala (2018-11-09 08:40:56)
> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx>
> > ---
> >  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?

Not the ordering of events, just the insensitivity of debugobjects. All
we are saying here is to remove the hash of this pointer from the set
of debugobjects so that when this memory block is freed we do not
complain that the debugobject still exists. To address the complaint, we
can just move to where the rcu transitions to being the llist, which I
had forgotten about.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux