iotest is a simple program for testing the effects of spatial locality. On start up, it does the following:
- Open a block device file for reading (/dev/sda, for example) using the O_DIRECT flag.
- For each 512 byte sector, do the following:
- Submit a read request for that sector and the next sector
- Seek back two sectors
- Repeat from 1 for a number of trials.
- Print out the sector number and the total amount of time taken by all the trials.