Re: normal I/O and sync I/O

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 3/27/08, Rik van Riel <riel@xxxxxxxxxxx> wrote:
> On Tue, 25 Mar 2008 18:10:14 +0530
> "Vijay Chauhan" <kernel.vijay@xxxxxxxxx> wrote:
>
> > what is asynchronous read/write operation? How it is different from
> > normal read/write operation?
> > Normally i have seen that the file read/write operation is set to
> > do_sync_read/write which in turns call to aio_read/write. So I could
> > not able understand the difference.
>
> After you do a normal read, the data you wanted is in the
> buffer you specified.  This magic happens because the read
> syscall code will wait for the data to be present, before
> returning to userspace.
>
> If you do an AIO read operation, the syscall will return
> immediately, even if the data has not been read from disk
> yet.  Your program cannot use the buffer yet.  Only after
> the IO has finished, and the kernel has sent an AIO
> completion event, can you use the data.
>
> In short, AIO is more difficult to use, but you can have
> multiple such IOs happening at the same time because your
> program can do other things (like issuing more AIO requests)
> while IO happens.
>
> Things are similar on the write side.
>

I would like to know the term Async in terms of cache as well.

Like if writing to cache and return back to user space is also
considered to be asynchronous I/O as the the data in the cache will be
sync to disk later? In that case the user space assume that the data
is written to the disk.  If SYNC flag has been passed, then the data
will directly written to the disk and not only in the cache.
So can we say that there is a kernel space async I/O and user space async I/O?

Rgds,
Adil
> --
> All rights reversed.
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux