Commit f57ebb9
committed
debugobjects: Implement batch processing
Adding and removing single objects in a loop is bad in terms of lock
contention and cache line accesses.
To implement batching, record the last object in a batch in the object
itself. This is trivialy possible as hlists are strictly stacks. At a batch
boundary, when the first object is added to the list the object stores a
pointer to itself in debug_obj::batch_last. When the next object is added
to the list then the batch_last pointer is retrieved from the first object
in the list and stored in the to be added one.
That means for batch processing the first object always has a pointer to
the last object in a batch, which allows to move batches in a cache line
efficient way and reduces the lock held time.
Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Zhen Lei <[email protected]>
Link: https://lore.kernel.org/all/[email protected]1 parent aebbfe0 commit f57ebb9
1 file changed
+46
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
153 | 156 | | |
154 | 157 | | |
155 | | - | |
156 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
157 | 162 | | |
158 | | - | |
159 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
160 | 167 | | |
161 | | - | |
162 | | - | |
163 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
164 | 177 | | |
165 | 178 | | |
166 | 179 | | |
| |||
182 | 195 | | |
183 | 196 | | |
184 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
185 | 201 | | |
186 | 202 | | |
187 | 203 | | |
188 | | - | |
189 | | - | |
| 204 | + | |
| 205 | + | |
190 | 206 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
195 | 219 | | |
196 | 220 | | |
197 | 221 | | |
| |||
226 | 250 | | |
227 | 251 | | |
228 | 252 | | |
229 | | - | |
| 253 | + | |
230 | 254 | | |
231 | 255 | | |
232 | 256 | | |
| |||
239 | 263 | | |
240 | 264 | | |
241 | 265 | | |
| 266 | + | |
242 | 267 | | |
243 | 268 | | |
244 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
245 | 276 | | |
246 | 277 | | |
247 | 278 | | |
| |||
0 commit comments