All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Francis Moreau <francis.moro@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Where does a process wait after requesting some data file ?
Date: Thu, 15 Jan 2009 07:00:13 -0700	[thread overview]
Message-ID: <20090115140013.GC29283@parisc-linux.org> (raw)
In-Reply-To: <38b2ab8a0901150550w7106f6ebwa7ae36f6f0d9ad3d@mail.gmail.com>

On Thu, Jan 15, 2009 at 02:50:27PM +0100, Francis Moreau wrote:
> Let's say that a process wants to read a page of data stored in a file.
> For that it issues a sys_read().
> 
> Now the data page is not in the page cache and it must be fetched from
> the disk.
> 
> So I assume while the data page is recovered from the disk, the process
> is suspended until the data are ready to be read.
> 
> Could anybody show me where in the source code where the process is
> suspended ?

Sure.  Take a look in mm/filemap.c.  Filesystems that use the page cache
will usually end up calling do_generic_file_read() one way or another.
It tries to find the page in the page cache, when it doesn't find the
page, it creates it, then calls ->readpage() to start the read, and
lock_page_killable() to wait for the page to be read.  As the comment
says, when the read finishes, it will unlock the page and the reader
will continue.

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2009-01-15 14:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 13:50 Where does a process wait after requesting some data file ? Francis Moreau
2009-01-15 14:00 ` Matthew Wilcox [this message]
2009-01-15 16:20   ` Manish Katiyar
2009-01-15 16:54     ` Matthew Wilcox
2009-01-15 16:56       ` Manish Katiyar
2009-01-16 16:30   ` Francis Moreau
2009-01-17 21:06     ` Matthew Wilcox
2009-01-17 22:07       ` Francis Moreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090115140013.GC29283@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=francis.moro@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.