Commit 8cd3fa4
slub: Delay freezing of partial slabs
Now we will freeze slabs when moving them out of node partial list to
cpu partial list, this method needs two cmpxchg_double operations:
1. freeze slab (acquire_slab()) under the node list_lock
2. get_freelist() when pick used in ___slab_alloc()
Actually we don't need to freeze when moving slabs out of node partial
list, we can delay freezing to when use slab freelist in ___slab_alloc(),
so we can save one cmpxchg_double().
And there are other good points:
- The moving of slabs between node partial list and cpu partial list
becomes simpler, since we don't need to freeze or unfreeze at all.
- The node list_lock contention would be less, since we don't need to
freeze any slab under the node list_lock.
We can achieve this because there is no concurrent path would manipulate
the partial slab list except the __slab_free() path, which is now
serialized by slab_test_node_partial() under the list_lock.
Since the slab returned by get_partial() interfaces is not frozen anymore
and no freelist is returned in the partial_context, so we need to use the
introduced freeze_slab() to freeze it and get its freelist.
Similarly, the slabs on the CPU partial list are not frozen anymore,
we need to freeze_slab() on it before use.
We can now delete acquire_slab() as it became unused.
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>1 parent 213094b commit 8cd3fa4
1 file changed
Lines changed: 24 additions & 91 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2166 | 2166 | | |
2167 | 2167 | | |
2168 | 2168 | | |
2169 | | - | |
| 2169 | + | |
2170 | 2170 | | |
2171 | 2171 | | |
2172 | 2172 | | |
| |||
2234 | 2234 | | |
2235 | 2235 | | |
2236 | 2236 | | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
2240 | | - | |
2241 | | - | |
2242 | | - | |
2243 | | - | |
2244 | | - | |
2245 | | - | |
2246 | | - | |
2247 | | - | |
2248 | | - | |
2249 | | - | |
2250 | | - | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
2255 | | - | |
2256 | | - | |
2257 | | - | |
2258 | | - | |
2259 | | - | |
2260 | | - | |
2261 | | - | |
2262 | | - | |
2263 | | - | |
2264 | | - | |
2265 | | - | |
2266 | | - | |
2267 | | - | |
2268 | | - | |
2269 | | - | |
2270 | | - | |
2271 | | - | |
2272 | | - | |
2273 | | - | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
2280 | | - | |
2281 | | - | |
2282 | 2237 | | |
2283 | 2238 | | |
2284 | 2239 | | |
| |||
2295 | 2250 | | |
2296 | 2251 | | |
2297 | 2252 | | |
2298 | | - | |
2299 | 2253 | | |
2300 | 2254 | | |
2301 | 2255 | | |
| |||
2314 | 2268 | | |
2315 | 2269 | | |
2316 | 2270 | | |
2317 | | - | |
| 2271 | + | |
2318 | 2272 | | |
2319 | 2273 | | |
2320 | 2274 | | |
| |||
2324 | 2278 | | |
2325 | 2279 | | |
2326 | 2280 | | |
2327 | | - | |
2328 | | - | |
2329 | | - | |
| 2281 | + | |
2330 | 2282 | | |
2331 | 2283 | | |
2332 | 2284 | | |
2333 | | - | |
2334 | 2285 | | |
2335 | 2286 | | |
2336 | 2287 | | |
| |||
2629 | 2580 | | |
2630 | 2581 | | |
2631 | 2582 | | |
2632 | | - | |
2633 | | - | |
2634 | | - | |
2635 | 2583 | | |
2636 | 2584 | | |
2637 | 2585 | | |
| |||
2644 | 2592 | | |
2645 | 2593 | | |
2646 | 2594 | | |
2647 | | - | |
2648 | | - | |
2649 | | - | |
2650 | | - | |
2651 | | - | |
2652 | | - | |
2653 | | - | |
2654 | | - | |
2655 | | - | |
2656 | | - | |
2657 | | - | |
2658 | | - | |
2659 | | - | |
2660 | | - | |
2661 | | - | |
2662 | | - | |
2663 | | - | |
| 2595 | + | |
2664 | 2596 | | |
2665 | 2597 | | |
2666 | 2598 | | |
| |||
3167 | 3099 | | |
3168 | 3100 | | |
3169 | 3101 | | |
3170 | | - | |
3171 | 3102 | | |
3172 | 3103 | | |
3173 | 3104 | | |
| |||
3243 | 3174 | | |
3244 | 3175 | | |
3245 | 3176 | | |
3246 | | - | |
| 3177 | + | |
| 3178 | + | |
3247 | 3179 | | |
3248 | 3180 | | |
3249 | 3181 | | |
| |||
3255 | 3187 | | |
3256 | 3188 | | |
3257 | 3189 | | |
3258 | | - | |
| 3190 | + | |
3259 | 3191 | | |
3260 | 3192 | | |
3261 | 3193 | | |
3262 | | - | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
3263 | 3204 | | |
| 3205 | + | |
3264 | 3206 | | |
3265 | 3207 | | |
3266 | 3208 | | |
3267 | 3209 | | |
3268 | 3210 | | |
3269 | 3211 | | |
3270 | 3212 | | |
3271 | | - | |
3272 | 3213 | | |
| 3214 | + | |
3273 | 3215 | | |
3274 | 3216 | | |
3275 | 3217 | | |
| |||
3281 | 3223 | | |
3282 | 3224 | | |
3283 | 3225 | | |
| 3226 | + | |
3284 | 3227 | | |
3285 | 3228 | | |
3286 | 3229 | | |
| |||
3682 | 3625 | | |
3683 | 3626 | | |
3684 | 3627 | | |
3685 | | - | |
3686 | | - | |
3687 | | - | |
3688 | | - | |
3689 | | - | |
3690 | | - | |
3691 | | - | |
3692 | | - | |
3693 | | - | |
3694 | | - | |
3695 | | - | |
3696 | | - | |
| 3628 | + | |
| 3629 | + | |
3697 | 3630 | | |
3698 | 3631 | | |
3699 | 3632 | | |
| |||
3723 | 3656 | | |
3724 | 3657 | | |
3725 | 3658 | | |
3726 | | - | |
| 3659 | + | |
3727 | 3660 | | |
3728 | | - | |
| 3661 | + | |
3729 | 3662 | | |
3730 | 3663 | | |
3731 | 3664 | | |
| |||
0 commit comments