Repository navigation
Commit b58fc80
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>1 parent 243d9f4 commit b58fc80
1 file changed
Lines changed: 33 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
195 | 194 | | |
| 195 | + | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
227 | | - | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
| |||
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
256 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
261 | 265 | | |
262 | 266 | | |
263 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
264 | 270 | | |
265 | | - | |
266 | 271 | | |
267 | 272 | | |
268 | 273 | | |
269 | | - | |
270 | | - | |
| 274 | + | |
271 | 275 | | |
272 | | - | |
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
| |||
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
825 | | - | |
826 | | - | |
| 828 | + | |
827 | 829 | | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
828 | 837 | | |
829 | 838 | | |
830 | 839 | | |
831 | 840 | | |
832 | 841 | | |
833 | | - | |
834 | | - | |
| 842 | + | |
835 | 843 | | |
836 | 844 | | |
837 | 845 | | |
| |||
867 | 875 | | |
868 | 876 | | |
869 | 877 | | |
| 878 | + | |
| 879 | + | |
870 | 880 | | |
871 | 881 | | |
872 | 882 | | |
| |||
922 | 932 | | |
923 | 933 | | |
924 | 934 | | |
925 | | - | |
926 | | - | |
| 935 | + | |
927 | 936 | | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
928 | 944 | | |
929 | 945 | | |
930 | 946 | | |
931 | 947 | | |
932 | | - | |
933 | | - | |
| 948 | + | |
934 | 949 | | |
935 | 950 | | |
936 | 951 | | |
| |||
966 | 981 | | |
967 | 982 | | |
968 | 983 | | |
| 984 | + | |
| 985 | + | |
969 | 986 | | |
970 | 987 | | |
971 | 988 | | |
| |||
0 commit comments