[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
linux page cache
I read the very interesting 'memory management'
chapter of this document :
http://www.linuxdoc.org/LDP/tlk/tlk.html
and in paragraphs 3.6, 3.7 and 3.8.1 it is said :
'The generic Linux nopage operation is used for memory
mapped executable images and it uses the page
cache to bring the required image page into physical
memory.'
...
'Memory mapped files are read a page at a time and
these pages are stored in the page cache. The page
cache consists of the page_hash_table, a vector of
pointers to mem_map_t data structures.'
...
Reducing the size of the page and buffer caches:
'If the examined page is in the Linux page cache, it
is removed from the page cache and freed.
As none of the freed pages were part of any process's
virtual memory (they were cached pages), then no page
tables need updating'
I've got 2 questions :
1 ) What kind of page or stored in the page cached :
pages from executable images only, or also data from
disk ?
2 ) When a file is memory mapped from disk, are all of
its pages automatically stored in the page cache ?
3 ) When in cache, are they duplicated in physical
memory and in page cache memory or do they stand only
in one place and are referenced twice (both in the
page_hash_table with mem_map_t and in the table page
entry) ?
Actually, what I try to understand the linux page
cache management.
That will make sense for me is the following procedure
:
- a process demand a file which is on disk
- It is memory mapped into physical memory
- the page tables entries are updated with the file's
pages
- after being used and not demanded for a (quite) long
time they are referenced by the page cached in the
page_hash_table, but no more in the page table (no
entries in it). And therefore they keep their fisrt
memory location.
Am I wrong ??
Could you please give me a concrete example of what's
happening in the page cache when we run a process ?
Thanks for any help.
=====
Sabrina
04-92-11-41-78
06-84-80-95-51
___________________________________________________________
Do You Yahoo!?
Achetez, vendez! Ā votre prix! Sur http://encheres.yahoo.fr
-
Linux-mm-www: builders list for the Linux-MM website
Archive: http://humbolt.nl.linux.org/lists/
Web site: http://www.linux.eu.org/Linux-MM/