Re: when does a process sleep in reading a file from disk?

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

 



On 10/29/05, Hui Cheng <hcheng@xxxxxxxxxxx> wrote:
>
> Thanks for your reply, Fawad :) I have the similar thought as you. I do
> believe that the current process would be put to sleep ( like in a wait
> queue) at sometime when the request is queued. However, I just cannot find
> the code that explicitly do this. I followed all the code from sys_read
> until __make_request, at where the request is queued in the request queue.
> I was wondering I might miss something. Could anybody help me out of it?
>
>

After your reply, I did some code study from __make_request
(ll_rw_blk.c) to actual storage driver and for this I studied the code
of drivers/block/floppy.c because floppy.c is the simplest real
storage driver. And I found that the sleeping is done by the real
hardware driver  (which I was thinking earlier too, but now confirm)
as when the request_function (do_fd_request) specified by the floppy.c
is called, after some processing it calls the process_fd_request which
calls the schedule_bh function (defined in floppy.c) schedules the
floppy_work with the handler redo_fd_request.

When the redo_fd_request is called from the schedule_work, it  use
make_raw_rw_request to actually fullfil the request and later
redo_fd_request calls request_done which through floppy_end_request
function ends/signals the kernel that request is done.

I hope this will help! You can also work-out on floppy.c in detail ...


--
Fawad Lateef

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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