Re: [RFC 02/12] drm/i915: Update client name on context create

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

 




On 10/03/2020 18:11, Chris Wilson wrote:
Quoting Tvrtko Ursulin (2020-03-09 18:31:19)
@@ -92,8 +107,8 @@ __i915_drm_client_register(struct i915_drm_client *client,
  static void
  __i915_drm_client_unregister(struct i915_drm_client *client)
  {
-       put_pid(fetch_and_zero(&client->pid));
-       kfree(fetch_and_zero(&client->name));
+       put_pid(rcu_replace_pointer(client->pid, NULL, true));
+       kfree(rcu_replace_pointer(client->name, NULL, true));

client_unregister is not after an RCU grace period, so what's the
protection here?

Against concurrent access via sysfs? Hm.. I think kobject_put needs to go first and clearing of name and pid last. Will fix this.

Accesses via GEM contexts always have a reference so that should be fine.

RCU business on pid and name is basically only so the two can be asynchronously replaced if need to be updated on context create. So anyone accessing them sees either old or new, but always valid data.

Regards,

Tvrtko
_______________________________________________
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