]> git.ipfire.org Git - people/ms/linux.git/commit
IB/core: use RCU for uverbs id lookup
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Mon, 2 Nov 2015 17:13:25 +0000 (12:13 -0500)
committerDoug Ledford <dledford@redhat.com>
Mon, 7 Dec 2015 21:39:26 +0000 (16:39 -0500)
commitd144da8c6f51f48ec39d891ea9dff80169c45f3b
treeb2cc120f870989c2cb4cdd328d0cf7f8355eb012
parent57ab2512138205fe7836332fb4742441e53907ff
IB/core: use RCU for uverbs id lookup

The current implementation gets a spin_lock, and at any scale with
qib and hfi1 post send, the lock contention grows exponentially
with the number of QPs.

idr_find() is RCU compatibile, so read doesn't need the lock.

Change to use rcu_read_lock() and rcu_read_unlock() in
__idr_get_uobj().

kfree_rcu() is used to insure a grace period between the
idr removal and actual free.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c
include/rdma/ib_verbs.h