Skip to content

RFE: speed up SEEK_DATA syscalls #18402

@devZer0

Description

@devZer0

file access on ZFS can be pathologically slow with SEEK_DATA, as txg_sync is getting triggered, when file contents changing during lseek

this can lead to pathological slow access pattern, like for example being reported here

https://bugzilla.proxmox.com/show_bug.cgi?id=7012

i.e. for example when writing zero data to qcow2 on top of btrfs from inside vm ( dd if=/dev/zero of=/dev/sdo bs=1024k oflag=sync) , i easily get >500MB/s on btrfs , whereas with zfs it drops down to 5MB/s. (on rotating disks with compression set to zstd, detect-zeroes=on for qcow2 disk)

that's a 100 times worse, and especially unfortunate, because effectively no real data from inside vm is being written to physical disk at all , bacause zero write inside vm should be either unmapped or compressed to nearly nothing. so, basically writes which don't hit the pyhsical disk at all can be dead slow, though because of "metadata & sync overhead".

so maybe there is room for improvement here.

i think i have seen other slowness reports related to SEEK_DATA/SEEK_HOLE, but don't remember what/where.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: FeatureFeature request or new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions