microsoft / diskspd

DISKSPD is a storage load generator / performance test tool from the Windows/Windows Server and Cloud Server Infrastructure Engineering teams
MIT License
1.15k stars 213 forks source link

Questions about the function issueNextIO() #212

Closed queclink closed 4 months ago

queclink commented 4 months ago

Hello dl2n,

I have a question in function issueNextIO().
How is it possible to randomly read files in this function when the working mode is not memory mapped? I found that the local variable ‘li’ is not involved in working in non memory mapped mode. Can it be said that when using file system mode, random read/write of files can be achieved simply by using the flag bit FILEFLAG_RANDOM_ACCESS? If that's the case, I can't understand this point.

Thanks.

dl2n commented 4 months ago

Look at where li comes from and where that (the OVERLAPPED structure) is initialized and then passed to. It is a little convoluted, but it is working as specified.

FILE_FLAG_RANDOM_ACCESS has nothing to do with where IO is issued. It is a hint to the file cache manager that it is not useful to try to predictively read ahead; only applies to buffered access.