Re: [Intel-gfx] [PATCH] drm/i915: Initialise the obj->rcu head
Quoting Mika Kuoppala (2018-11-09 10:32:30) > Chris Wilson 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. > > > > v2: mark the obj->rcu as being destroy when we reuse its location for > > the freed list. > > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108691 > > Signed-off-by: Chris Wilson > > Reviewed-by: Mika Kuoppala Merged the first as it will close a couple of bugs, care to check over the second? :) -Chris ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH] drm/i915: Initialise the obj->rcu head
Chris Wilson 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. > > v2: mark the obj->rcu as being destroy when we reuse its location for > the freed list. > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108691 > Signed-off-by: Chris Wilson Reviewed-by: Mika Kuoppala > --- > drivers/gpu/drm/i915/i915_gem.c | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index dc120b5d8e05..1c9a41ea6834 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(>lut_list); > INIT_LIST_HEAD(>batch_pool_link); > > + init_rcu_head(>rcu); > + > obj->ops = ops; > > reservation_object_init(>__builtin_resv); > @@ -5005,6 +5007,13 @@ static void __i915_gem_free_object_rcu(struct rcu_head > *head) > container_of(head, typeof(*obj), rcu); > struct drm_i915_private *i915 = to_i915(obj->base.dev); > > + /* > + * We reuse obj->rcu for the freed list, so we had better not treat > + * is like a rcu_head from this point forwards. And we expect all > + * objects to be freed via this path. > + */ > + destroy_rcu_head(>rcu); > + > /* >* Since we require blocking on struct_mutex to unbind the freed >* object from the GPU before releasing resources back to the > -- > 2.19.1 > > ___ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH] drm/i915: Initialise the obj->rcu head
Make the rcu_head known to the system, in particular for debugobjects. And having declared it for debugobjects, we need to tidy up afterwards. v2: mark the obj->rcu as being destroy when we reuse its location for the freed list. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108691 Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index dc120b5d8e05..1c9a41ea6834 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(>lut_list); INIT_LIST_HEAD(>batch_pool_link); + init_rcu_head(>rcu); + obj->ops = ops; reservation_object_init(>__builtin_resv); @@ -5005,6 +5007,13 @@ static void __i915_gem_free_object_rcu(struct rcu_head *head) container_of(head, typeof(*obj), rcu); struct drm_i915_private *i915 = to_i915(obj->base.dev); + /* +* We reuse obj->rcu for the freed list, so we had better not treat +* is like a rcu_head from this point forwards. And we expect all +* objects to be freed via this path. +*/ + destroy_rcu_head(>rcu); + /* * Since we require blocking on struct_mutex to unbind the freed * object from the GPU before releasing resources back to the -- 2.19.1 ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx