Commit 7a16609
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.com1 parent c16e2fd commit 7a16609
1 file changed
+15
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| |||
1556 | 1555 | | |
1557 | 1556 | | |
1558 | 1557 | | |
1559 | | - | |
1560 | 1558 | | |
1561 | 1559 | | |
1562 | 1560 | | |
| |||
1629 | 1627 | | |
1630 | 1628 | | |
1631 | 1629 | | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
1632 | 1643 | | |
1633 | 1644 | | |
1634 | 1645 | | |
1635 | 1646 | | |
1636 | 1647 | | |
1637 | | - | |
| 1648 | + | |
1638 | 1649 | | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
| 1650 | + | |
1648 | 1651 | | |
1649 | | - | |
1650 | 1652 | | |
1651 | 1653 | | |
1652 | 1654 | | |
| |||
1682 | 1684 | | |
1683 | 1685 | | |
1684 | 1686 | | |
1685 | | - | |
1686 | 1687 | | |
1687 | 1688 | | |
1688 | 1689 | | |
| |||
0 commit comments