How to recognize synchronous write requests

Peter Teoh htmldeveloper at gmail.com
Sat Jul 23 03:29:30 EDT 2011


On Fri, Jul 15, 2011 at 11:31 PM, Amirali Shambayati <
amirali.shambayati at gmail.com> 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
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110723/d506eb1b/attachment.html 


More information about the Kernelnewbies mailing list