I've similarly used
posix_fadvise (LWN article) to avoid trashing caches while timeshifting live TV on the YouView set-top box. It seemed to work well and avoided all the gotchas associated with
O_DIRECT. It was based on the advice from Linus on how to copy files avoid cache trashing and without
You can find the documentation and code for this on github.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds