Commit 40fd0ac
committed
slub: avoid list_lock contention from __refill_objects_any()
Kernel test robot has reported a regression in the patch "slab: refill
sheaves from all nodes". When taken in isolation like this, there is
indeed a tradeoff - we prefer to use remote objects prior to allocating
new local slabs. It is replicating a behavior that existed before
sheaves for replenishing cpu (partial) slabs - now called
get_from_any_partial() to allocate a single object.
So the possibility of allocating remote objects is intended even if
remote accesses are then slower. But the profiles in the report also
suggested a contention on the list_lock spinlock. And that's something
we can try to avoid without much tradeoff - if someone else has the
spin_lock, it's more likely they are allocating from the node than
freeing to it, so we can skip it even if it means allocating a new local
slab - contributing to that lock's contention isn't worth it. It should
not result in partial slabs accumulating on the remote node.
Thus add an allow_spin parameter to __refill_objects_node() and
get_partial_node_bulk() to make the attempts from __refill_objects_any()
use only a trylock.
Reported-by: kernel test robot <oliver.sang@intel.com>
Link: https://lore.kernel.org/oe-lkp/202601132136.77efd6d7-lkp@intel.com
Link: https://patch.msgid.link/20260129-b4-refill_any_trylock-v1-1-de7420b25840@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>1 parent 6f19121 commit 40fd0ac
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3378 | 3378 | | |
3379 | 3379 | | |
3380 | 3380 | | |
3381 | | - | |
| 3381 | + | |
| 3382 | + | |
3382 | 3383 | | |
3383 | 3384 | | |
3384 | 3385 | | |
| |||
3390 | 3391 | | |
3391 | 3392 | | |
3392 | 3393 | | |
3393 | | - | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
3394 | 3398 | | |
3395 | 3399 | | |
3396 | 3400 | | |
| |||
6544 | 6548 | | |
6545 | 6549 | | |
6546 | 6550 | | |
6547 | | - | |
| 6551 | + | |
| 6552 | + | |
6548 | 6553 | | |
6549 | 6554 | | |
6550 | 6555 | | |
| |||
6556 | 6561 | | |
6557 | 6562 | | |
6558 | 6563 | | |
6559 | | - | |
| 6564 | + | |
6560 | 6565 | | |
6561 | 6566 | | |
6562 | 6567 | | |
| |||
6650 | 6655 | | |
6651 | 6656 | | |
6652 | 6657 | | |
6653 | | - | |
| 6658 | + | |
| 6659 | + | |
6654 | 6660 | | |
6655 | 6661 | | |
6656 | 6662 | | |
| |||
6691 | 6697 | | |
6692 | 6698 | | |
6693 | 6699 | | |
6694 | | - | |
| 6700 | + | |
| 6701 | + | |
6695 | 6702 | | |
6696 | 6703 | | |
6697 | 6704 | | |
| |||
0 commit comments