On Fri, Jul 15, 2011 at 11:31 PM, Amirali Shambayati < [email protected]> wrote:
> Hi all, > > As much as I know, type of an IO request can be realized by "DATA_DIR" > macro,but I wanted to know if it is possible to distinguish a read or > write is synchronous or asychronous. > > I'm also using "blktrace" to extract requests dispatching to disk. > blktrace, determines synchrnous writes as "ws" and asynchronous writes > as "w". > > at the electronics level, it is much easier to design things to run synchronously (another similar term is "isochronous" operation, eg, http://h10032.www1.hp.com/ctg/Manual/bph07333.pdf), and from many hardware timing diagram, u can see these making transition based on different signals received - behaving in a deterministic way to complete a state transition machine. ie, a read is a read, and not "read later". it is the software that does the asynchronous operation - "read" becomes "read later" - thus opening a window of duration where data may not be written as requested - that is the tradeoff or sacrifices for async operation. historically, async I/O comes later (http://lwn.net/Articles/94566/) as it is quite difficult to implement (but it do have the feature of non-blocking, http://en.wikipedia.org/wiki/Asynchronous_I/O). there is the issue of reordering the data read if multiple read happens within the latency window. PCI do have a hardware feature called "write posting" - whereby multiple read/write can be submitted, and the actual operation only happen in a burst mode - normally reading multiple blocks at the same time. i may be wrong somewhere above, but at the low level (device driver) it may not possible to distinguish between sync or async operation - unless the hardware has the ability to report on the mode it is currently set - and from software perspective we can deduce it being synchronous or asynchronous. (eg, if write posting is enabled in hardware, then async is enabled - make sense?) criticism welcomed :-). > Regards, > > -- > Amirali Shambayati > Bachelor Student > Computer Engineering Department > Sharif University of Technology > Tehran, Iran > > _______________________________________________ > Kernelnewbies mailing list > [email protected] > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > -- Regards, Peter Teoh
_______________________________________________ Kernelnewbies mailing list [email protected] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
