Changes between Version 4 and Version 5 of ConcurrentHashTable
- Timestamp:
- 2012-08-08T12:03:57Z (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ConcurrentHashTable
v4 v5 142 142 compared to acquiring a spinlock. The figure above shows the number of traversals 143 143 or updates of a five element list with an increasing percentage of updates. 144 The benchmark ran in 4 threads/CPUs. In each iteration athread selected at random144 The benchmark ran in 4 threads/CPUs. In each iteration each thread selected at random 145 145 whether to walk the entire list or to replace an item in the list (ie to update the 146 list). All items were preallocated. More is better ;-). 146 list). All items were preallocated. More is better ;-). The figure on the right 147 details the effects of increasing the update percentage by leaving out the data point for 0% updates. 147 148 - //ideal// - the list was accessed without any synchronization whatsoever on a single cpu; 148 149 and the result multiplied by the number of cpus (ie 4) 149 150 - //a-rcu + spinlock// - each list traversal and update was protected by A-RCU; concurrent updates 150 were synchronized by means of a spinlock 151 were synchronized by means of a spinlock, but removed items were freed via {{{rcu_call()}}} 151 152 - //podzimek-rcu + spinlock// - same as a-rcu but protected by preemptible version of Podzimek's RCU 152 153 - //spinlock// - guarded by an ordinary preemption disabling spinlock 154 155 When the update fraction is small, RCU protected list traversals and modifications 156 significantly outperform a spinlock guarded list. However, as the percent of updates 157 increases the cost of acquiring a spinlock to modify the list quickly begins to dominate. 158 In the case of RCU protected lists, updating a list involves not only locking a spinlock 159 but also posting and rcu callback. Therefore, protecting an often modified list with a 160 spinlock eventually outperforms RCU guarded lists. The cross over point is around 40% 161 and 60% of updates for Podzimek's RCU and A-RCU respectively. Again A-RCU fare a bit 162 better than the preemptible version of Podzimek's RCU. 153 163 154 164 To reproduce these results, switch to the kernel console and run: