LKML Archive on
help / color / mirror / Atom feed
From: Nick Piggin <>
To: Xin Zhao <>
Subject: Re: page cache question
Date: Mon, 27 Feb 2006 20:03:22 +1100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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 

  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/>
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:

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

  git send-email \ \ \ \ \
    --subject='Re: page cache question' \

* 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).