Commit cc970d2
btrfs: add tracepoint for search slot restart tracking
Add a btrfs_search_slot_restart tracepoint that fires at each restart
site in btrfs_search_slot(), recording the root, tree level, and
reason for the restart. This enables tracking search slot restarts
which contribute to COW amplification under memory pressure.
The four restart reasons are:
- write_lock: insufficient write lock level, need to restart with
higher lock
- setup_nodes: node setup returned -EAGAIN
- slot_zero: insertion at slot 0 requires higher write lock level
- read_block: read_block_for_search returned -EAGAIN (block not
cached or lock contention)
COW counts are already tracked by the existing trace_btrfs_cow_block()
tracepoint. The per-restart-site tracepoint avoids counter overhead
in the critical path when tracepoints are disabled, and provides
richer per-event information that bpftrace scripts can aggregate into
counts, histograms, and per-root breakdowns.
Reviewed-by: Filipe Manana <[email protected]>
Reviewed-by: Boris Burkov <[email protected]>
Signed-off-by: Leo Martins <[email protected]>
Signed-off-by: David Sterba <[email protected]>1 parent f9a4854 commit cc970d2
2 files changed
Lines changed: 32 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2102 | 2102 | | |
2103 | 2103 | | |
2104 | 2104 | | |
| 2105 | + | |
2105 | 2106 | | |
2106 | 2107 | | |
2107 | 2108 | | |
| |||
2164 | 2165 | | |
2165 | 2166 | | |
2166 | 2167 | | |
2167 | | - | |
| 2168 | + | |
| 2169 | + | |
2168 | 2170 | | |
| 2171 | + | |
2169 | 2172 | | |
2170 | 2173 | | |
2171 | 2174 | | |
| |||
2181 | 2184 | | |
2182 | 2185 | | |
2183 | 2186 | | |
| 2187 | + | |
2184 | 2188 | | |
2185 | 2189 | | |
2186 | 2190 | | |
| |||
2194 | 2198 | | |
2195 | 2199 | | |
2196 | 2200 | | |
2197 | | - | |
| 2201 | + | |
| 2202 | + | |
2198 | 2203 | | |
| 2204 | + | |
2199 | 2205 | | |
2200 | 2206 | | |
2201 | 2207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1113 | 1113 | | |
1114 | 1114 | | |
1115 | 1115 | | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
1116 | 1140 | | |
1117 | 1141 | | |
1118 | 1142 | | |
| |||
0 commit comments