Re: [PATCH v2 1/2] drm/i915: Add perf property support for context HW id

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

 



Quoting Zhenyu Wang (2017-07-19 06:39:48)
> +static struct i915_gem_context *
> +lookup_context_hw_id(struct drm_i915_private *dev_priv, unsigned int hw_id)
> +{
> +       struct i915_gem_context *ctx;
> +       int ret;
> +
> +       ret = i915_mutex_lock_interruptible(&dev_priv->drm);
> +       if (ret)
> +               return ERR_PTR(ret);
> +
> +       list_for_each_entry(ctx, &dev_priv->contexts.list, link) {
> +               if (!i915_gem_context_is_default(ctx))
> +                       continue;

This is still a massive what? Why ban normal contexts? Why are you not
banning the kernel context?

> +
> +               if (ctx->hw_id == hw_id) {
> +                       ret = 1;
> +                       i915_gem_context_get(ctx);
> +                       break;

Bad news, your reference counting is still broken. You actually need an
i915_gem_context_get_rcu() variant for pulling from this list.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux