|
|
Subscribe / Log in / New account

Performance problems reading files with holes

Performance problems reading files with holes

Posted Apr 6, 2017 12:16 UTC (Thu) by fishface60 (subscriber, #88700)
Parent article: Performance problems reading files with holes

> Ted Ts'o noted that SEEK_HOLE is an ioctl() command that is implemented by the filesystems.

It's a whence value for lseek isn't it, or is it some kernel jargon that SEEK_HOLE gets implemented as an ioctl call that gets called by the lseek call.


to post comments

Performance problems reading files with holes

Posted Apr 7, 2017 12:18 UTC (Fri) by koverstreet (✭ supporter ✭, #4296) [Link]

SEEK_DATA and SEEK_HOLE are a real pain to implement due to the fact that data may be in the page cache (and not written yet) or on disk (and not cached) - you have to simultaneously walk the page cache and your extent mappings.

(This might not be true for other filesystems depending on how they implement delayed allocation, but I suspect btrfs is roughly in the same boat as bcachefs here).

There's likely room for someone to improve things by creating some better VFS helpers, if they were interested in such a thing.

If anyone's interested, here's the code for SEEK_DATA/SEEK_HOLE in bcachefs - though I'm still not really happy with it:

https://evilpiepirate.org/git/bcachefs.git/tree/fs/bcache...


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds