Re: [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Izik Eidus
Date: Wednesday, November 12, 2008 - 4:11 am

Avi Kivity wrote:
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/4] rmap: add page_wrprotect() function,, Izik Eidus, (Tue Nov 11, 6:21 am)
[PATCH 3/4] add ksm kernel shared memory driver, Izik Eidus, (Tue Nov 11, 6:21 am)
[PATCH 4/4] MMU_NOTIFIRES: add set_pte_at_notify(), Izik Eidus, (Tue Nov 11, 6:21 am)
Re: [PATCH 1/4] rmap: add page_wrprotect() function,, Andrew Morton, (Tue Nov 11, 12:39 pm)
Re: [PATCH 0/4] ksm - dynamic page sharing driver for linux, Andrea Arcangeli, (Tue Nov 11, 12:55 pm)
Re: [PATCH 1/4] rmap: add page_wrprotect() function,, Andrea Arcangeli, (Tue Nov 11, 1:38 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Andrew Morton, (Tue Nov 11, 1:38 pm)
Re: [PATCH 1/4] rmap: add page_wrprotect() function,, Andrew Morton, (Tue Nov 11, 2:01 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Tue Nov 11, 2:06 pm)
Re: [PATCH 1/4] rmap: add page_wrprotect() function,, Andrea Arcangeli, (Tue Nov 11, 2:17 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Tue Nov 11, 2:21 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Tue Nov 11, 2:26 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Tue Nov 11, 2:31 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Tue Nov 11, 2:35 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Tue Nov 11, 2:47 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Andrea Arcangeli, (Tue Nov 11, 3:03 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Jonathan Corbet, (Tue Nov 11, 3:03 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Izik Eidus, (Tue Nov 11, 3:17 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Tue Nov 11, 3:17 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Tue Nov 11, 3:24 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Jonathan Corbet, (Tue Nov 11, 3:25 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Tue Nov 11, 3:30 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Jonathan Corbet, (Tue Nov 11, 3:30 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Izik Eidus, (Tue Nov 11, 3:31 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Izik Eidus, (Tue Nov 11, 3:38 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Valdis.Kletnieks, (Tue Nov 11, 3:40 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Avi Kivity, (Tue Nov 11, 3:43 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Avi Kivity, (Tue Nov 11, 3:49 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Izik Eidus, (Tue Nov 11, 4:02 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Andrea Arcangeli, (Tue Nov 11, 4:03 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Tue Nov 11, 4:17 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Tue Nov 11, 4:25 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Tue Nov 11, 5:27 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., KAMEZAWA Hiroyuki, (Tue Nov 11, 7:19 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Tue Nov 11, 7:27 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Tue Nov 11, 8:10 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Izik Eidus, (Wed Nov 12, 4:11 am)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Wed Nov 12, 10:32 am)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Lee Schermerhorn, (Wed Nov 12, 1:08 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Wed Nov 12, 1:27 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Christoph Lameter, (Wed Nov 12, 1:31 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Lee Schermerhorn, (Wed Nov 12, 3:09 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Wed Nov 12, 7:00 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., Andrea Arcangeli, (Wed Nov 12, 7:31 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., KAMEZAWA Hiroyuki, (Wed Nov 12, 11:11 pm)
Re: [PATCH 3/4] add ksm kernel shared memory driver, Eric Rannaud, (Wed Nov 12, 11:13 pm)
Re: [PATCH 2/4] Add replace_page(), change the mapping of ..., KAMEZAWA Hiroyuki, (Thu Nov 13, 4:32 am)