<br><br><div class="gmail_quote">On Fri, Jul 15, 2011 at 11:31 PM, Amirali Shambayati <span dir="ltr"><<a href="mailto:amirali.shambayati@gmail.com">amirali.shambayati@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi all,<br>
<br>
As much as I know, type of an IO request can be realized by "DATA_DIR"<br>
macro,but I wanted to know if it is possible to distinguish a read or<br>
write is synchronous or asychronous.<br>
<br>
I'm also using "blktrace" to extract requests dispatching to disk.<br>
blktrace, determines synchrnous writes as "ws" and asynchronous writes<br>
as "w".<br>
<br></blockquote><div><br></div><div>at the electronics level, it is much easier to design things to run synchronously (another similar term is "isochronous" operation, eg, <a href="http://h10032.www1.hp.com/ctg/Manual/bph07333.pdf">http://h10032.www1.hp.com/ctg/Manual/bph07333.pdf</a>), 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. </div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>historically, async I/O comes later (<a href="http://lwn.net/Articles/94566/">http://lwn.net/Articles/94566/</a>) as it is quite difficult to implement (but it do have the feature of non-blocking, <a href="http://en.wikipedia.org/wiki/Asynchronous_I/O">http://en.wikipedia.org/wiki/Asynchronous_I/O</a>). there is the issue of reordering the data read if multiple read happens within the latency window.</div>
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>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.</div>
<div><br></div><div>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?)</div>
<div><br></div><div>criticism welcomed :-).</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Regards,<br>
<br>
--<br>
Amirali Shambayati<br>
Bachelor Student<br>
Computer Engineering Department<br>
Sharif University of Technology<br>
Tehran, Iran<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Peter Teoh<br>