linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Izik Eidus <ieidus@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: avi@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kvm@vger.kernel.org, aarcange@redhat.com, chrisw@redhat.com
Subject: Re: [PATCH 0/4] ksm - dynamic page sharing driver for linux
Date: Tue, 11 Nov 2008 21:52:51 +0200	[thread overview]
Message-ID: <4919E293.6040600@redhat.com> (raw)
In-Reply-To: <20081111113247.c2b0f1ac.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Tue, 11 Nov 2008 21:18:23 +0200
> Izik Eidus <ieidus@redhat.com> wrote:
>
>   
>>> hm.
>>>
>>> There has been the occasional discussion about idenfifying all-zeroes
>>> pages and scavenging them, repointing them at the zero page.  Could
>>> this infrastructure be used for that?  (And how much would we gain from
>>> it?)
>>>
>>> [I'm looking for reasons why this is more than a muck-up-the-vm-for-kvm
>>> thing here ;) ]
>>>       
>
> ^^ this?
>
>   
>> KSM is separate driver , it doesn't change anything in the VM but adding 
>> two helper functions.
>>     
>
> What, you mean I should actually read the code?   Oh well, OK.
>   
Andrea i think what is happening here is my fault
i will try to give here much more information about KSM:
first the bad things:
KSM shared pages are right now (we have patch that can change it but we 
want to wait with it) unswappable
this mean that the entire memory of the guest is swappable but the pages 
that are shared are not.
(when the pages are splited back by COW they become anonymous again with 
the help of do_wp_page()
the reason that the pages are not swappable is beacuse the way the Linux 
Rmap is working, this not allow us to create nonlinear anonymous pages
(we dont want to use nonlinear vma for kvm, as it will make swapping for 
kvm very slow)
the reason that ksm pages need to have nonlinear reverse mapping is that 
for one guest identical page can be found in whole diffrent offset than 
other guest have it
(this is from the userspace VM point of view)

the rest is quite simple:
it is walking over the entire guest memory (or only some of it) and scan 
for identical pages using hash table
it merge the pages into one single write protected page

numbers for ksm is something that i have just for desktops and just the 
numbers i gave you
what is do know is:
big overcommit like 300% is possible just when you take into account 
that some of the guest memory will be free
we are sharing mostly the DLLs/ KERNEL / ZERO pages, for the DLLS and 
KERNEL PAGEs this pages likely will never break
but ZERO pages will be break when windows will allocate them and will 
come back when windows will free the memory.
(i wouldnt suggest 300% overcommit for servers workload, beacuse you can 
end up swapping in that case,
but for desktops after runing in production and passed some seiroes qa 
tress tests it seems like 300% is a real number that can be use)

i just ran test on two fedora 8 guests and got that results (using GNOME 
in both of them)
 9959 root      15   0  730m 537m 281m S    8  3.4   0:44.28 
kvm                                                                            

 9956 root      15   0  730m 537m 246m S    4  3.4   0:41.43 kvm
as you can see the physical sharing was 281mb and 246mb (kernel pages 
are counted as shared)
there is small lie in this numbers beacuse pages that was shared across 
two guests and was splited by writing from guest number 1 will still 
have 1 refernce count to it
and will still be kernel page (untill the other guest (num 2) will write 
to it as well)


anyway i am willing to make much better testing or everything that 
needed for this patchs to be merged.
(just tell me what and i will do it)

beside that you should know that patch 4 is not a must, it is just nice 
optimization...

thanks.

--
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:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-11-11 19:52 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 13:21 [PATCH 0/4] ksm - dynamic page sharing driver for linux Izik Eidus
2008-11-11 13:21 ` [PATCH 1/4] rmap: add page_wrprotect() function, Izik Eidus, Izik Eidus
2008-11-11 13:21   ` [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another Izik Eidus, Izik Eidus
2008-11-11 13:21     ` [PATCH 3/4] add ksm kernel shared memory driver Izik Eidus, Izik Eidus
2008-11-11 13:21       ` [PATCH 4/4] MMU_NOTIFIRES: add set_pte_at_notify() Izik Eidus, Izik Eidus
2008-11-11 20:38       ` [PATCH 3/4] add ksm kernel shared memory driver Andrew Morton
2008-11-11 22:03         ` Andrea Arcangeli
2008-11-11 22:03       ` Jonathan Corbet
2008-11-11 22:17         ` Izik Eidus
2008-11-11 22:25           ` Jonathan Corbet
2008-11-11 22:31             ` Izik Eidus
2008-11-11 22:30           ` Jonathan Corbet
2008-11-11 22:38             ` Izik Eidus
2008-11-11 23:02             ` Izik Eidus
2008-11-11 23:03             ` Andrea Arcangeli
2008-11-11 22:49           ` Avi Kivity
2008-11-11 22:40         ` Valdis.Kletnieks
2008-11-13  6:13           ` Eric Rannaud
2008-11-11 22:43         ` Avi Kivity
2008-11-11 19:45     ` [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another Andrew Morton
2008-11-11 20:57       ` Izik Eidus
2008-11-11 21:21         ` Christoph Lameter
2008-11-11 21:23           ` Izik Eidus
2008-11-11 21:31             ` Christoph Lameter
2008-11-11 21:37               ` Izik Eidus
2008-11-11 22:24               ` Andrea Arcangeli
2008-11-12  2:19                 ` KAMEZAWA Hiroyuki
2008-11-12 10:05                   ` Avi Kivity
2008-11-12 11:11                     ` Izik Eidus
2008-11-13  6:11                       ` KAMEZAWA Hiroyuki
2008-11-13 10:38                         ` Izik Eidus
2008-11-13 11:32                           ` KAMEZAWA Hiroyuki
2008-11-11 21:35           ` Andrea Arcangeli
2008-11-11 21:06       ` Andrea Arcangeli
2008-11-11 21:26         ` Christoph Lameter
2008-11-11 21:39           ` Avi Kivity
2008-11-11 21:47             ` Christoph Lameter
2008-11-11 21:55               ` Izik Eidus
2008-11-11 22:36               ` Avi Kivity
2008-11-11 22:17           ` Andrea Arcangeli
2008-11-11 22:30             ` Christoph Lameter
2008-11-11 23:17               ` Andrea Arcangeli
2008-11-11 23:25                 ` Andrea Arcangeli
2008-11-12  0:27                 ` Christoph Lameter
2008-11-12  2:27                   ` Andrea Arcangeli
2008-11-12  3:10                     ` Christoph Lameter
2008-11-12 17:32                       ` Andrea Arcangeli
2008-11-12 20:08                         ` Lee Schermerhorn
2008-11-12 20:31                           ` Christoph Lameter
2008-11-12 20:27                         ` Christoph Lameter
2008-11-12 22:09                           ` Lee Schermerhorn
2008-11-13  2:00                             ` Andrea Arcangeli
2008-11-13  2:31                               ` Andrea Arcangeli
2008-11-13  4:02                                 ` Nick Piggin
2008-11-11 19:39   ` [PATCH 1/4] rmap: add page_wrprotect() function, Andrew Morton
2008-11-11 20:38     ` Andrea Arcangeli
2008-11-11 21:01       ` Andrew Morton
2008-11-11 21:17         ` Andrea Arcangeli
2008-11-11 18:30 ` [PATCH 0/4] ksm - dynamic page sharing driver for linux Andrew Morton
2008-11-11 18:48   ` Avi Kivity
2008-11-11 19:08     ` Izik Eidus
2008-11-11 19:11     ` Andrew Morton
2008-11-11 19:18       ` Izik Eidus
2008-11-11 19:32         ` Andrew Morton
2008-11-11 19:52           ` Izik Eidus [this message]
2008-11-11 20:08             ` Izik Eidus
2008-11-11 19:29       ` Avi Kivity
2008-11-11 19:55       ` Andrea Arcangeli
2008-11-11 19:07   ` Izik Eidus
2008-11-11 19:20     ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2009-03-30 23:59 Izik Eidus
2009-03-31  1:42 ` Anthony Liguori
2009-03-31 12:33   ` Izik Eidus
2009-04-02 19:22 ` Jesper Juhl
2009-04-02 19:38   ` Izik Eidus
2009-04-02 19:39   ` Chris Wright
2009-04-02 19:49     ` Jesper Juhl

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=4919E293.6040600@redhat.com \
    --to=ieidus@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=chrisw@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).