Re: page cache - process memory - disk read
From: hopehope_123 (hopehope_123_at_yahoo.com)
Date: 09/26/05
- Next message: P Ruetz: "FC vs CentOS (or equiv)"
- Previous message: Dimitris Mexis: "SELinux"
- In reply to: Tommy Reynolds: "Re: page cache - process memory - disk read"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 26 Sep 2005 06:44:29 -0700
Hi Tommy ,
Thanks for your help.I think if i go on working on this issue,i will
clarify whether ocfs really uses direct io or not on my system:
> Where does the pages which are read from the disk is mapped inside a
> process?
-They are not mapped if you are simply doing read{v}/write{v} type
-I/O. Disk file content is placed into the kernel page cache and
-*copied* to your program buffer. If you are performing asynchronous
-I/O, this copy might not take place and the data can be written
-directly into the application buffer.
Do you mean the heap segment by saying program buffer and application
buffer?
char *buf ; buf=malloc(1000);
this buf is allocated inside the heap segment . And i think it does not
matter what i put inside it. I can store some file data inside the buf
, but since it is allocated inside the heap as anonymous page, it can
be paged out to the swap disk if necessary .
> As far as i know , if the pages which are modified like this , needs to be
> written to the swap disk in order to be reused again .
Sorry, no. Just because a page gets marked as dirty doesn't mean
that it every sees the swap device.
Imagine that the os wants to use the memory of buf in above. Doesnt it
first write it to the swap disk? (isnt it an inactive_dirty page ?) How
could it be possible to reuse this page without writing its contents to
the swap file?
-Ordinary file I/O always takes two copy operations:
-1) Disk content is copied from the media into kernel memory, the page
- cache; often by DMA hardware on the disk controller, so this is
- relatively fast.
-2) Bytes are copied between the kernel page cache and the application
- buffer by the kernel equivalent of memcpy(3). This is much slower
- than copy #1 above.
-Various schemes exist to speed up or eliminate copy #2. Check into
-asynchronous I/O, for an example.
How could copy#2 be faster than copy1? (I think here the copy1 is done
after the data is read from the disk.)
My system doe not support async io , here do you mean kernel asycnio?
At the same time , i have the same topic under the solaris group .:
Kind Regards,
tolga
- Next message: P Ruetz: "FC vs CentOS (or equiv)"
- Previous message: Dimitris Mexis: "SELinux"
- In reply to: Tommy Reynolds: "Re: page cache - process memory - disk read"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|