<br><br><div class="gmail_quote">On Wed, Apr 18, 2012 at 2:39 AM, Ramshankar <span dir="ltr"><<a href="mailto:ramshankar.venkataraman@oracle.com" target="_blank">ramshankar.venkataraman@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Our current page fusion logic involves knowledge from within the guest<br>
as to what can be fused. Instead of pegging through the entire guest<br>
memory using some-sort of daemon/service and maintaining hashes and<br>
last-touch times of pages and comparing them, our guest additions<br>
(currently page fusion implemented only for Windows guests) gives hints<br>
about which pages are most likely candidates for fusion.<br>
<br>
This saves a lot of time than sweeping the memory but it also means we<br>
will not be squeezing out every last bit. We made this trade-off<br>
decision because we felt this is a good approach for the fulfilling the<br>
objective.<br></blockquote><div>I read a project <a href="http://code.google.com/p/uksm">http://code.google.com/p/uksm</a> which is improving KSM's scan speed and result. It is called UKSM.</div><div>in a type of hardware, Interl Core 2 9300, KSM scans page at 260M/s. UKSM can hit 477MB/s - 923M/s, even 627- 2446MB/s in the pages which doesn't contain duplications. I think the speed is a big factor here to do the tradeoff. full memory scan can avoid the duplication of anony memory pages. will this change your decision about the tradeoff?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
A daemon on the guest runs which locates common system files/dlls/ro<br>
kernel memory etc. paged-in on the guest and reports the physical pages<br>
that can be deduplicated. We don't scan the guest memory actively<br>
looking for fusion candidates. If the guest touches the pages for write<br>
access that'll be marked as no longer a candidate. Because of<br>
contextually knowledge from within the guest, VirtualBox's page fusion<br>
identifies only long term fusion candidates that are very unlikely to be<br>
touched often.<br>
<br>
That's just the broad overview.<br>
<br>
Regards,<br>
Ram<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 04/16/12 05:23 PM, Alexey Eromenko wrote:<br>
>><br>
>> What kind if obstacles would I face if I tried to implemented the<br>
>> same behavior (Scan processes) for Linux guests? I plan on scanning every<br>
>> process then check the memory maps from /proc/<pid>/maps. If the permissions<br>
>> are set to r only or rx then I'll register the pages with the host. This<br>
>> wouldn't cover the process it self, but a major portion of<br>
>> the wasted memory.<br>
>><br>
>> Sounds simple (everything does these days) and I plan to work it. However, I<br>
>> just need an expert to give me the go-ahead since this is all new to me.<br>
><br>
> I think before undertaking such a massive effort, it pays off to<br>
> compare existing (Open-Source) technologies: Linux KSM vs. VBox<br>
> PageFusion.<br>
><br>
> Why ?<br>
> KSM *avoids* the need of developing guest-side drivers altogether.<br>
> With KSM all mem dedup logic is done host-side-only, so all legacy and<br>
> future OSes work out-of-the-box.<br>
> VBox PageFusion requires GuestAdditions, which means developing and<br>
> testing (!) drivers for lots of guest OSes and OS versions.<br>
> Developing KSM-equivalent for VBox may pay off better than extending<br>
> VBox PageFusion to Linux guests (this will require writing new Linux<br>
> kernel drivers).<br>
> KSM itself is Linux-host-only, so cannot be used directly. (While VBox<br>
> PageFusion is Windows-guest-only ATM)<br>
> KSM-like system will require only host-side development and testing.<br>
><br>
> What needs to be considered ? (KSM-like approach vs. VBox PageFusion approach)<br>
> 1. performance - how much CPU usage does it takes ?<br>
> 2. speed convergence [related to 1.] - how much time does it take to<br>
> find 1 GiB of RAM and dedup it ?<br>
> 3. efficiency - how many pages were actually shared ?<br>
> 4. any other advantages/disadvantages of both approaches.<br>
><br>
> Disclaimer: I have NOT tested either solution. Just my 2 cents.<br>
<br>
<br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
vbox-dev mailing list<br>
<a href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a><br>
<a href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>-Howard<br>