Commit 805c7b4
committed
nlm: use ConcurrentHashMap to store the locks
Though access to the lock storage serialized for the same file, the
Multimap still throws ConcurrentModificationException.
Use ConcurrentHashMap to store locks as it gives a better throughput:
// Multimaps#synchronizedListMultimap
Result "org.dcache.nfs.v4.nlm.SimpleLmBenchmark.benchmarkConcurrentLocking":
437057.460 ±(99.9%) 18574.458 ops/s [Average]
(min, avg, max) = (372606.415, 437057.460, 467748.621), stdev = 24796.370
CI (99.9%): [418483.001, 455631.918] (assumes normal distribution)
// ConcurrentHashMap
Result "org.dcache.nfs.v4.nlm.SimpleLmBenchmark.benchmarkConcurrentLocking":
744594.337 ±(99.9%) 45860.571 ops/s [Average]
(min, avg, max) = (592325.817, 744594.337, 847798.786), stdev = 61222.550
CI (99.9%): [698733.766, 790454.908] (assumes normal distribution)
Fixes: #70
Acked-by: Paul Millar
Target: master, 0.171 parent 92e12da commit 805c7b4
1 file changed
+26
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
| 24 | + | |
26 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
51 | | - | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | | - | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
68 | | - | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
75 | 86 | | |
76 | 87 | | |
77 | 88 | | |
78 | 89 | | |
79 | 90 | | |
80 | | - | |
| 91 | + | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
84 | 96 | | |
85 | 97 | | |
86 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
87 | 105 | | |
88 | 106 | | |
89 | 107 | | |
| |||
0 commit comments