LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2009, 10:52 PM   #1
sidc7
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 0
Copy on write and page initialization


Hi,

As far as I understand, Linux uses the COW optimization so parent and child process share the same address space, till one of them writes to it, at which point the kernel creates a copy of the page written to. This is done through the function do_wp_page which in turn calls cow_user_page.

I created a simple program, where the child and parent process write to a variable differently. I have instrumented the kernel at cow_user_page. On inserting the kprobe module and running the fork program, I do not get a call to cow_user_page. I had several questions:
1. Does this mean that the kernel is not doing COW optimization?
2. Is COW enabled by default, if not, how do we turn it on?
3. Any other point in the kernel, where cow is done, other than cow_user_page?

Regarding page initialization, if I understand it correctly, the kernel calls get_zeroed_page when it has to allocated a zeroed page, once again in my kernel module, I have probes the kernel at get_zeroed_page, but get no calls, even on running the system for a long time, any other place where the kernel gets zeroed pages to return the applications ?



Any help would be appreciated, thanks in advance
SC
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Write-On-Copy when fork a new process frisky Linux - General 5 08-29-2008 11:30 AM
A sharp AR-5316 copy blank page msaleh General 2 07-03-2008 08:53 PM
How to write a man page Nerox Programming 2 03-22-2005 06:44 AM
copy on write dummyagain Programming 2 11-15-2003 10:28 AM


All times are GMT -5. The time now is 04:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration