diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-09-03 10:45:59 -0700 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2024-09-05 16:56:14 +0200 |
commit | cc01bd044e6a521d2cd128f685ee8d23ef0067f2 (patch) | |
tree | 8fae8a6534fefde18200e51121096b4bb0dcdca2 /drivers/net/ethernet/intel/igc/igc_ethtool.c | |
parent | 59da880afed211c989ef65da577b24215ce57774 (diff) |
uprobes: travers uprobe's consumer list locklessly under SRCU protection
uprobe->register_rwsem is one of a few big bottlenecks to scalability of
uprobes, so we need to get rid of it to improve uprobe performance and
multi-CPU scalability.
First, we turn uprobe's consumer list to a typical doubly-linked list
and utilize existing RCU-aware helpers for traversing such lists, as
well as adding and removing elements from it.
For entry uprobes we already have SRCU protection active since before
uprobe lookup. For uretprobe we keep refcount, guaranteeing that uprobe
won't go away from under us, but we add SRCU protection around consumer
list traversal.
Lastly, to keep handler_chain()'s UPROBE_HANDLER_REMOVE handling simple,
we remember whether any removal was requested during handler calls, but
then we double-check the decision under a proper register_rwsem using
consumers' filter callbacks. Handler removal is very rare, so this extra
lock won't hurt performance, overall, but we also avoid the need for any
extra protection (e.g., seqcount locks).
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lore.kernel.org/r/20240903174603.3554182-5-andrii@kernel.org
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_ethtool.c')
0 files changed, 0 insertions, 0 deletions