Re: process memory and page cache clarification is needed

From: hopehope_123 (hopehope_123_at_yahoo.com)
Date: 09/26/05


Date: 26 Sep 2005 06:25:49 -0700

Hi Anton ,

Thanks for your mail.

Can we say that For directio (this is what i really use , both on ufs
and also on ocfs - oracle clustered file system) , based on your mail ,
only step 1 and 4 exist?

-If you read from a file using read(), the file pages are not mapped
-into the process's address space at all. They are mapped temporarily
-by the kernel and then the data is copied into the process's buffer.

Here , 'the data is copied into the process's buffer' means process
heap segment (as anon pages ) doesnt it?

At this point ,
i know that when a process reads a file , heap segment is the place
that is used to hold the file data.

If i use directio, instead of using page cache , the data is directly
read from the disk into the process .

*buf=65;

This modification also means modification in heap segment , and if it
is necessary it can be paged out to swap disk.

At this point , now consider , i modify the file by using the contents
of the buffer:

pwrite(18,buf, 16384, 1506574336) = 16384

according to the all these things , I think , If the memory which
stores the buf is pagedout at the time of this call , then first of all
it must be paged in. This has no relation with disk file and page
cache. ( )

If file is cached inside the page cache , then it must be updated
inside the page cache , (I think these are the pages which are created
at step 2) (the kernel updates these cached data inside the kernel
address space ,) then these pages must be written to the data file on
the disk .At this time we know that there exists some memory pages
inside the page cahce which are dirty and hold file system data. Now if
operating system needs to use these pages , how does it behave? Does
the operating system page out these data pages by writing them to the
data file (not swap file) in order to make them free?

Kind Regards,
tolga



Relevant Pages

  • Re: Yanking out a USB stick without ejecting
    ... not having been pushed out to the disk yet. ... The file system does ALL its I/O through the file system buffer ... used as the file system buffer cache). ...
    (comp.sys.mac.system)
  • Re: what to do with "too much" RAM?
    ... > and such but the general rule is to NEVER cache writes. ... That depends what the raid controller and disk controllers ... > Think about server crash, power loss, file system integrity and do the math. ...
    (comp.unix.solaris)
  • Re: Yanking out a USB stick without ejecting
    ... transferred the data to the disk, it shows you what it has buffered up ... The file system does ALL its I/O through the file system buffer ... used as the file system buffer cache). ...
    (comp.sys.mac.system)
  • Re: Fast file writes without having large data flushes to disk
    ... file system driver, I assumed that it's a separate component, and the lower ... level drivers have other cache mechanisms, ... just disk activity; this is most likely an OS or disk driver ... And are there tools that can show the amount of file system ...
    (microsoft.public.win32.programmer.kernel)
  • Re: direct IO or cache Io on LINUX server?
    ... using DirectIO, so we create a directIO slice just for these types of ... and ORACLE 9ir2. ... I/O policy to choice - direct IO and cache IO. ...
    (RedHat)