When we reaplacing page using page_replace() we have:
oldpage - > anonymous page that is going to be replaced by newpage
newpage -> kernel allocated page (KsmPage)
so about oldpage we are calling page_remove_rmap() that will notify cgroup
and about newpage it wont be count inside cgroup beacuse it is file rmap
page
(we are calling to page_add_file_rmap), so right now PageKSM wont ever
be tracked by cgroup.
The caller of page_replace does know it, the only problem is that
page_remove_rmap()
automaticly change the cgroup for anonymous pages,
if we want it not to change the cgroup, we can:
increase the cgroup count before page_remove (but in that case what
happen if we reach to the limit???)
give parameter to page_remove_rmap() that we dont want the cgroup to be
changed.
KSM have no anonymous pages (it share anonymous pages into KsmPAGE ->
kernel allocated page without mapping)
so it isnt in LRU and it cannt be swapped, only when KsmPAGEs will be
break by do_wp_page() the duplication will be able to swap.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html