Bug 178387 - [zfs] [patch] sparse files performance improvements
Summary: [zfs] [patch] sparse files performance improvements
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 9.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
Depends on:
Reported: 2013-05-07 10:00 UTC by nowak
Modified: 2017-12-31 22:27 UTC (History)
0 users

See Also:

file.diff (7.07 KB, patch)
2013-05-07 10:00 UTC, nowak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nowak 2013-05-07 10:00:00 UTC
Sparse files in ZFS are slow. Default behavior is to allocate a temporary dbuf, zero it and destroy on return. There is no caching. Bandwidth is limited by cpu time bzeroing temporary dbufs.

The attached patch avoids creating temporary dbufs.

4k reads are important for mmapped files.

without the patch:

zfs recordsize=128k, 4k reads:
104857600 bytes transferred in 1.178753 secs (88956388 bytes/sec)

zfs recordsize=8M, 4k reads:
8388608 bytes transferred in 9.134382 secs (918355 bytes/sec)

with the patch:

zfs recordsize=128k, 4k reads: (13x improvement)
1048576000 bytes transferred in 0.904384 secs (1159436525 bytes/sec)

zfs recordsize=8M, 4k reads: (over 1000x improvement)
1048576000 bytes transferred in 0.909877 secs (1152437009 bytes/sec)

Fix: Patch attached with submission follows:
How-To-Repeat: # truncate -s 1000m testfile
# time dd if=testfile of=/dev/null bs=4k
Comment 1 Xin LI freebsd_committer 2013-05-08 21:01:52 UTC
Responsible Changed
From-To: freebsd-bugs->zfs-devel

Over to zfs-devel@ for review.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2013-08-15 04:43:25 UTC
Responsible Changed
From-To: zfs-devel->freebsd-fs
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:21 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped