ZFS prefetch problem

Mickaël Maillot mickael.maillot at gmail.com
Thu Dec 31 16:13:25 UTC 2009


this bug is referenced:
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6859997
and a good description can be found here:
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6861397
and a long thread on zfs-discuss
http://mail.opensolaris.org/pipermail/zfs-discuss/2009-July/029710.html

i use bob friesenhahn's script to test (with little mod)
http://www.simplesystems.org/users/bfriesen/zfs-discuss/zfs-cache-test.ksh

so i test on my hardware for reading 3000 8M files

without prefetch: no problem
initial
real    7m49.039s
user    0m2.931s
sys     0m22.574s
second
real    7m48.080s
user    0m2.858s
sys     0m32.559s

with prefetch enable:
initial
real    2m55.163s
user    0m2.244s
sys     0m10.072s
second
real    7m37.522s
user    0m2.367s
sys     0m10.565s

ok i hit the same bug.
it was fix by this commit:
http://hg.intevation.org/mirrors/opensolaris.org/onnv-gate/rev/0e96dd3b905a
which add kstats for prefetch and a bug in rollback (not for us)

the only modif for the prefetch + arc problem is resolv by:
--- dmu_zfetch.c.orig   2009-12-31 15:46:15.211700719 +0100
+++ dmu_zfetch.c        2009-12-31 15:46:42.915461251 +0100
@@ -323,7 +323,8 @@
                 * we will read "len" blocks before "striding".
                 */
                if (zh->zst_offset >= zs->zst_offset &&
-                   zh->zst_offset < zs->zst_offset + zs->zst_len) {
+                   zh->zst_offset < zs->zst_offset + zs->zst_len &&
+                       prefetched) {
                        /* already fetched */
                        rc = 1;
                        goto out;

with this patch i have:
initial
real    2m57.614s
user    0m2.228s
sys     0m10.054s
second
real    2m45.403s
user    0m2.445s
sys     0m9.726s
third
real    2m16.381s
user    0m2.152s
sys     0m9.136s

looks good.
tested on 8-STABLE amd64, with/without log/cache ssd. (but not with zil_disable)


More information about the freebsd-fs mailing list