Project

General

Profile

Actions

Bug #8835

closed

Speculative prefetch in ZFS not working for misaligned reads

Added by Alexander Motin almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2017-11-20
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

Sequential reads not aligned to block size are not detected by ZFS prefetcher as sequential, killing prefetch and severely hurting performance:

# dd if=/dev/zvol/test0/zzz of=/dev/null bs=128k
819200+0 records in
819200+0 records out
107374182400 bytes transferred in 253.025509 secs (424361096 bytes/sec)
# dd if=/dev/gpt/zzz of=/dev/null bs=128k
^C815838+0 records in
815838+0 records out
106933518336 bytes transferred in 683.459370 secs (156459218 bytes/sec)
# dd if=/dev/zvol/test0/zzz of=/dev/null bs=128k
^C486400+0 records in
486400+0 records out
63753420800 bytes transferred in 150.415240 secs (423849477 bytes/sec)
# dd if=/dev/gpt/zzz of=/dev/null bs=128k
^C22129+0 records in
22129+0 records out
2900492288 bytes transferred in 18.267249 secs (158781015 bytes/sec)

, where gpt/zzz is misaligned partition of zvol/test0/zzz.

I found that it is caused by dmu_zfetch() in case of misaligned sequential accesses being called with overlap of one block:

dmu_zfetch(fffff80198dd0ae0, 27347, 9, 1)
dmu_zfetch(fffff80198dd0ae0, 27355, 9, 1)
dmu_zfetch(fffff80198dd0ae0, 27363, 9, 1)
dmu_zfetch(fffff80198dd0ae0, 27371, 9, 1)
dmu_zfetch(fffff80198dd0ae0, 27379, 9, 1)
dmu_zfetch(fffff80198dd0ae0, 27387, 9, 1)

Actions

Also available in: Atom PDF