Commit fe2961f
f2fs: avoid f2fs_map_blocks() for consecutive holes in readpages
For consecutive large hole mapping across {d,id,did}nodes , we don't
need to call f2fs_map_blocks() to check one hole block per one time,
instead, we can use map.m_next_pgofs as a hint of next potential valid
block, so that we can skip calling f2fs_map_blocks the range of
[cur_pgofs + 1, .m_next_pgofs).
1) regular case
touch /mnt/f2fs/file
truncate -s $((1024*1024*1024)) /mnt/f2fs/file
time dd if=/mnt/f2fs/file of=/dev/null bs=1M count=1024
Before:
real 0m0.706s
user 0m0.000s
sys 0m0.706s
After:
real 0m0.620s
user 0m0.008s
sys 0m0.611s
2) large folio case
touch /mnt/f2fs/file
truncate -s $((1024*1024*1024)) /mnt/f2fs/file
f2fs_io setflags immutable /mnt/f2fs/file
sync
echo 3 > /proc/sys/vm/drop_caches
time dd if=/mnt/f2fs/file of=/dev/null bs=1M count=1024
Before:
real 0m0.438s
user 0m0.004s
sys 0m0.433s
After:
real 0m0.368s
user 0m0.004s
sys 0m0.364s
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>1 parent d194f11 commit fe2961f
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2164 | 2164 | | |
2165 | 2165 | | |
2166 | 2166 | | |
2167 | | - | |
2168 | | - | |
| 2167 | + | |
| 2168 | + | |
2169 | 2169 | | |
| 2170 | + | |
| 2171 | + | |
2170 | 2172 | | |
| 2173 | + | |
2171 | 2174 | | |
2172 | 2175 | | |
2173 | 2176 | | |
| |||
2442 | 2445 | | |
2443 | 2446 | | |
2444 | 2447 | | |
2445 | | - | |
| 2448 | + | |
2446 | 2449 | | |
2447 | 2450 | | |
2448 | 2451 | | |
| |||
2475 | 2478 | | |
2476 | 2479 | | |
2477 | 2480 | | |
2478 | | - | |
2479 | | - | |
| 2481 | + | |
| 2482 | + | |
2480 | 2483 | | |
| 2484 | + | |
| 2485 | + | |
| 2486 | + | |
2481 | 2487 | | |
| 2488 | + | |
2482 | 2489 | | |
2483 | 2490 | | |
2484 | 2491 | | |
2485 | 2492 | | |
2486 | 2493 | | |
2487 | 2494 | | |
| 2495 | + | |
2488 | 2496 | | |
2489 | 2497 | | |
2490 | 2498 | | |
| |||
2611 | 2619 | | |
2612 | 2620 | | |
2613 | 2621 | | |
| 2622 | + | |
2614 | 2623 | | |
2615 | 2624 | | |
2616 | 2625 | | |
| |||
2631 | 2640 | | |
2632 | 2641 | | |
2633 | 2642 | | |
2634 | | - | |
| 2643 | + | |
2635 | 2644 | | |
2636 | 2645 | | |
2637 | 2646 | | |
| |||
0 commit comments