I am trying to hash a whole bunch of files and want to saturate I/O on my system as well as reasonably possible. This use case makes three things simultaneously true
- I will read the file only once
- I will need the whole file
- The file will be read sequentially
Can I combine fadvise() suggestions, or if I make multiple suggestions on the same range does one override the other?
I am trying three sequential calls since it seems like policies can't be OR'd like flags.
os.posix_fadvise(f, 0, 0, os.POSIX_FADV_SEQUENTIAL)
os.posix_fadvise(f, 0, 0, os.POSIX_FADV_WILLNEED)
os.posix_fadvise(f, 0, 0, os.POSIX_FADV_NOREUSE)
But before I was just advising WILLNEED. From the man page it seems to just set a read ahead buffer policy and WILLNEED seems most sensible, but it's also true that I need to grab data sequentially off of an HDD, and I don't intend to read it a second time.
Is the behaviour for this even defined or is it just up to the implementer for the target platform?