]> www.infradead.org Git - users/jedix/linux-maple.git/commit
uprobes: kill xol_area->slot_count
authorOleg Nesterov <oleg@redhat.com>
Tue, 1 Oct 2024 14:24:59 +0000 (16:24 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 7 Oct 2024 07:28:45 +0000 (09:28 +0200)
commit7a166094bd2b1c084fd215747f9cd05a853d66c9
tree01da11ab3a925931f2ba3ebd3a7eed3498903853
parentc16e2fdd746c78f5b2ce3c2ab8a26a61b6ed09e5
uprobes: kill xol_area->slot_count

Add the new helper, xol_get_slot_nr() which does
find_first_zero_bit() + test_and_set_bit().

xol_take_insn_slot() can wait for the "xol_get_slot_nr() < UINSNS_PER_PAGE"
event instead of "area->slot_count < UINSNS_PER_PAGE".

So we can kill area->slot_count and avoid atomic_inc() + atomic_dec(), this
simplifies the code and can slightly improve the performance.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20241001142458.GA13629@redhat.com
kernel/events/uprobes.c