From: sidc7 <siddhartha.chhabra@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Copy on write and page initialization
Date: Mon, 23 Feb 2009 20:50:05 -0800 (PST) [thread overview]
Message-ID: <22175803.post@talk.nabble.com> (raw)
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
--
View this message in context: http://www.nabble.com/Copy-on-write-and-page-initialization-tp22175803p22175803.html
Sent from the linux-kernel mailing list archive at Nabble.com.
next reply other threads:[~2009-02-24 4:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-24 4:50 sidc7 [this message]
2009-02-24 9:17 ` Copy on write and page initialization Nick Piggin
2009-02-24 9:47 ` sidc7
2009-02-26 21:26 ` Frank Ch. Eigler
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22175803.post@talk.nabble.com \
--to=siddhartha.chhabra@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox