Files
android_kernel_xiaomi_sm8450/drivers/infiniband/sw/rdmavt
Mike Marciniszyn b58fc80497 IB/hfi1: Eliminate synchronize_rcu() in mr delete
The synchronize_rcu() call can be eliminated to improve memory deregistration
performance.

There are two key fields involved:
- The rcu pointer itself
- the lkey_published field

To close the window between the rcu read of the mregion pointer and the
reference count the code should:

1. To lkey/rkey validation (reader)

Read the rcu pointer.  If the pointer is non-NULL, get a reference.

To the current validation tests use a READ_ONCE() on the lkey_published.

Upon any failure release the reference.

2. To the remove logic (delete)

Insure the published is zeroed prior to setting the pointer to NULL.
This requires using rcu_assign_pointer() to insure lkey_published
is written prior to the NULL.

3. To the insert logic (add)

Insure the published is set use an rcu_assign_pointer() to insure the
pointer is after all MR fields.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-04-05 14:45:09 -04:00
..
2016-03-10 20:37:27 -05:00
2016-03-10 20:37:27 -05:00
2016-03-10 20:37:27 -05:00
2016-08-02 16:00:58 -04:00
2016-03-10 20:37:27 -05:00
2016-03-10 20:37:27 -05:00
2016-12-11 15:29:42 -05:00
2016-12-11 15:25:13 -05:00
2016-12-11 15:25:13 -05:00
2016-03-10 20:37:27 -05:00