Commit e30b5dc
ext4: fix fio regression
We (Linux Kernel Performance project) found a regression introduced
by commit:
f7fec03 ext4: track all extent status in extent status tree
The commit causes about 20% performance decrease in fio random write
test. Profiler shows that rb_next() uses a lot of CPU time. The call
stack is:
rb_next
ext4_es_find_delayed_extent
ext4_map_blocks
_ext4_get_block
ext4_get_block_write
__blockdev_direct_IO
ext4_direct_IO
generic_file_direct_write
__generic_file_aio_write
ext4_file_write
aio_rw_vect_retry
aio_run_iocb
do_io_submit
sys_io_submit
system_call_fastpath
io_submit
td_io_getevents
io_u_queued_complete
thread_main
main
__libc_start_main
The cause is that ext4_es_find_delayed_extent() doesn't have an
upper bound, it keeps searching until a delayed extent is found.
When there are a lots of non-delayed entries in the extent state
tree, ext4_es_find_delayed_extent() may uses a lot of CPU time.
Reported-by: LKP project <[email protected]>
Signed-off-by: Yan, Zheng <[email protected]>
Signed-off-by: Zheng Liu <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>1 parent 0d606e2 commit e30b5dc
File tree
5 files changed
+23
-14
lines changed- fs/ext4
- include/trace/events
5 files changed
+23
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3642 | 3642 | | |
3643 | 3643 | | |
3644 | 3644 | | |
3645 | | - | |
| 3645 | + | |
3646 | 3646 | | |
3647 | 3647 | | |
3648 | 3648 | | |
| |||
4608 | 4608 | | |
4609 | 4609 | | |
4610 | 4610 | | |
4611 | | - | |
4612 | | - | |
4613 | 4611 | | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
4614 | 4615 | | |
4615 | 4616 | | |
4616 | 4617 | | |
| |||
4630 | 4631 | | |
4631 | 4632 | | |
4632 | 4633 | | |
4633 | | - | |
| 4634 | + | |
4634 | 4635 | | |
4635 | 4636 | | |
4636 | 4637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
| 235 | + | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | | - | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
250 | | - | |
| 252 | + | |
| 253 | + | |
251 | 254 | | |
252 | 255 | | |
253 | 256 | | |
| |||
270 | 273 | | |
271 | 274 | | |
272 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
273 | 280 | | |
274 | 281 | | |
275 | 282 | | |
| |||
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
288 | | - | |
| 295 | + | |
289 | 296 | | |
290 | 297 | | |
291 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2139 | 2139 | | |
2140 | 2140 | | |
2141 | 2141 | | |
2142 | | - | |
| 2142 | + | |
2143 | 2143 | | |
2144 | 2144 | | |
2145 | 2145 | | |
| |||
2161 | 2161 | | |
2162 | 2162 | | |
2163 | 2163 | | |
2164 | | - | |
| 2164 | + | |
2165 | 2165 | | |
2166 | 2166 | | |
2167 | 2167 | | |
| |||
0 commit comments