lkml.org 
[lkml]   [2005]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectHow to identify cow (copy-on-write) pages during kernel execution?
Hi all,

I would like to know if there is a way to identify
struct page that is cow (copy-on-write).

The way I figured out to identify cow pages is when
copy-on-write happens. I mean I identify cow pages
inside the do_wp_page(), the function that handles
copy-on-write. I have checked do_no_page() as well.

I have included a field (is_cow) in the struct page to
identify cow page.

struct page {
...
atomic_t is_cow;
}

But I wonder if it is possible to identify cow pages
before copy-on-write happens. So identify cow pages in
advance before any process tries to write to a cow
page.

I have checked the do_fork(), copy_process() and
copy_mm() function to try to identify cow pages during
the process creation, but no success. In copy_mm(),
just the mm (of current process) is provided to the
child process, but there are no references to struct
pages related to mm and its VMAs.

So when a page struct is considered a cow in the
kernel and its count variable is updated? Certainly
the counter page (page->_count) is updated when a page
is shared because of copy-on-write feature.
How can I identify cow pages when it becomes cow? Is
there any feasible way to perform that?

BR,

Mauricio Lin.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-06-20 07:48    [W:0.241 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site