* do_wp_page
@ 2003-07-30 19:14 Raghu R. Arur
2003-07-31 10:35 ` do_wp_page Mel Gorman
0 siblings, 1 reply; 3+ messages in thread
From: Raghu R. Arur @ 2003-07-30 19:14 UTC (permalink / raw)
To: linux-mm
hi,
In do_wp_page of 2.4.19 why is the rss value of address space
incremented only when the old_page ( the page on which the process faults
due to write protection) is a reserved page. I mean if the process has
mapped a read only page ( which is different from a ZERO_PAGE) and if it
faults on that page when it tries to
write, the rss value is not incremented even if a new page is created
and page table entry is set to the allocated page. What am i missing here?
new_page = alloc_page(GFP_HIGHUSER);
if (!new_page)
goto no_mem;
copy_cow_page(old_page,new_page,address);
/*
* Re-check the pte - we dropped the lock
*/
spin_lock(&mm->page_table_lock);
if (pte_same(*page_table, pte)) {
if (PageReserved(old_page)) {
++mm->rss;
}
break_cow(vma, new_page, address, page_table);
lru_cache_add(new_page);
/* Free the old page.. */
new_page = old_page;
}
thanks,
Raghu
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: do_wp_page
2003-07-30 19:14 do_wp_page Raghu R. Arur
@ 2003-07-31 10:35 ` Mel Gorman
2003-07-31 10:43 ` do_wp_page Mel Gorman
0 siblings, 1 reply; 3+ messages in thread
From: Mel Gorman @ 2003-07-31 10:35 UTC (permalink / raw)
To: Raghu R. Arur; +Cc: linux-mm
On Wed, 30 Jul 2003, Raghu R. Arur wrote:
> In do_wp_page of 2.4.19 why is the rss value of address space
> incremented only when the old_page ( the page on which the process faults
> due to write protection) is a reserved page.
The page been faulted is a copy-on-write page so it's shared between more
than one process. If the process had 10 pages present before the fault,
it'll still will have 10 pages after the fault so the rss is not updated.
If the PageReserved() is true, it's the system wide ZERO_PAGE (PG_reserved
is set at boot time) and as far as I know, the system wide zero page is
the only one that can be mapped into a process with that bit set. If you
look at do_no_page(), you'll see that the zero page is not accounted for
in the RSS. If a COW takes place on the zero page, the process will be
using one more page than it was previously so rss++.
--
Mel Gorman
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-07-31 10:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-30 19:14 do_wp_page Raghu R. Arur
2003-07-31 10:35 ` do_wp_page Mel Gorman
2003-07-31 10:43 ` do_wp_page Mel Gorman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox