LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Xin Zhao <uszhaoxin@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: page cache question
Date: Mon, 27 Feb 2006 20:03:22 +1100	[thread overview]
Message-ID: <4402C05A.2020404@yahoo.com.au> (raw)
In-Reply-To: <4ae3c140602262345g43e71a2oea7db21c05dd5aba@mail.gmail.com>

Xin Zhao wrote:
> Sorry if this question is dumb.
> 
> Linux uses address_space to identify pages in the page cache. An
> address space is often associated with a memory object such as inode.
> That seems to associate the cached page with that inode. My question
> is: if a file is closed and the inode is destroyed, will the cached
> page be removed from page cache immediately?  If so, does that mean

Yes. The inode's struct address_space contains the radix tree which
indexes the pagecache pages.

> the file system has to load data from disk again if a user promptly
> open and read the same file again? If not, how does linux determine
> when to evict a cached page? using LRU?
> 

Yes they would have to be read again. However in general the inode is
not destroyed after the file is closed -- inodes are cached too.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2006-02-27  9:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-27  7:45 Xin Zhao
2006-02-27  9:03 ` Nick Piggin [this message]
2007-08-05 16:32 Page Cache Question Adnan Khaleel
2007-08-05 17:46 ` Tino Keitel
2007-08-05 18:01 ` Andi Kleen
2007-08-14 10:14 ` Helge Hafting
2007-08-14 14:38   ` Eugene Teo
2007-08-05 17:24 Page Cache question Adnan Khaleel
     [not found] <fa.ak7dGOAL/3/Q6eQ0zKX2KgaiWdU@ifi.uio.no>
2007-08-05 17:38 ` Robert Hancock

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=4402C05A.2020404@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=uszhaoxin@gmail.com \
    --subject='Re: page cache question' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).