RDMA/mlx5: Use RCU and direct refcounts to keep memory alive
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 8 Jan 2020 17:21:53 +0000 (19:21 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 13 Jan 2020 20:17:19 +0000 (16:17 -0400)
commit6898d1c661d79f4707d8ba82991b2195822780ca
tree9a9beb1ffb18967ab7bf320d686d7705fa1004f7
parent8bdf9dd984c18375d1090ddeb1792511f619c5c1
RDMA/mlx5: Use RCU and direct refcounts to keep memory alive

dispatch_event_fd() runs from a notifier with minimal locking, and relies
on RCU and a file refcount to keep the uobject and eventfd alive.

As the next patch wants to remove the file_operations release function
from the drivers, re-organize things so that the devx_event_notifier()
path uses the existing RCU to manage the lifetime of the uobject and
eventfd.

Move the refcount puts to a call_rcu so that the objects are guaranteed to
exist and remove the indirect file refcount.

Link: https://lore.kernel.org/r/1578504126-9400-2-git-send-email-yishaih@mellanox.com
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c
drivers/infiniband/core/rdma_core.h
drivers/infiniband/hw/mlx5/devx.c
include/rdma/uverbs_types.h