[vbox-dev] LogFlow() statements...

Ramshankar ramshankar.venkataraman at oracle.com
Mon Dec 17 10:21:00 GMT 2012

Hi Sandeep,

While I didn't write any of the page fusion code I'll try to answer with 
what I know. Perhaps when someone with more intimate knowledge of the 
code has time to answer they can provide their input. For now, verify 
with the actual sources as necessary.

See inline replies.

On 12/14/2012 12:38 AM, Sandeep Koppala wrote:
> Hi Ram,
> Thanks for the reply.
> We went ahead and modified the code in VBoxServicePageSharing.cpp. We 
> basically added a function VBoxServicePageSharingInspectG
> uest( ) that compiles for linux platform. In this functions, we are 
> trying to register modules from the linux guest using information 
> obtained from /proc/modules; we are calling the function 
> VbglR3RegisterSharedModule( ) for the same. < The very function that 
> is used by the code for windows > We are also invoking 
> VbglR3CheckSharedModules( ) after registering, as is being done in 
> case of windows.
> We have not been able to get any successful results so far (as 
> reported by the VBoxManage metrics). A couple of concerns are:
> 1. Parameters for VbglR3RegisterSharedModule( ):
>    a. Name of the module
>    b. Version of the module
>    c. Base address of the module (Virtual Address)
>    d. Base size of the module
>    e. No. of regions (elements in VMMDEVSHAREDREGIONDESC array)
>    f. An array describing various memory regions in the module 
> - Is our understanding correct ? Or is there anything wrong ?
Yes that is correct.

One question: How exactly are you using the metrics command to check if 
the page sharing is working? I presume the same command you use works 
with Windows guests with page sharing and shows the memory being 
returned to the host/shared with VMs, in which case ignore this question.

> 2. We are trying to pass each module from /proc/modules in the Linux 
> guest as ONE single region. The name, base address and size are 
> available from /proc/modules. We are passing a dummy value for the 
> version, and filling the array with one entry - address and size.
> Your comments on the same. Any insights will be helpful, as we are 
> pretty much stuck. Sorry for this verbose email.

The output of /proc/modules varies with distros (compile options of the 
linux kernel) so some of the key, required information might not be 
available from them. You probably knew this but mentioning it here as a 
premise for possibly requiring something more low-level.

However, this is a good start in retrieving the information from 
userland. You can communicate via the vboxguest kernel driver and also 
dig out relevant information from the kernel if the kernel has better 
interfaces for it (haven't really investigated).

Regarding passing the entire loaded-modules as sharable memory might 
work for a workload of the very same guest. It looks like you can 
proceed with this approach and see how it works. If necessary we can fit 
in better interfaces for determining kernel module information when the 
basic infrastructure works.

Hope this helps,

> Thanks
> ------------------------------------------------------------------------
> *From:* Ramshankar [ramshankar.venkataraman at oracle.com]
> *Sent:* Monday, December 10, 2012 5:45 AM
> *To:* Sandeep Koppala
> *Cc:* vbox-dev at virtualbox.org
> *Subject:* Re: [vbox-dev] LogFlow() statements...
> On 12/07/2012 04:32 AM, Sandeep Koppala wrote:
>> Hi all,
>> I am trying to implement Page Fusion for x64 Linux guests. I 
>> understand that this will require changes to the Guest Additions. 
>> Specifically, in the VBoxServicePageSharing.cpp code. I have made 
>> some changes here and I am trying to call VbglR3RegisterSharedModule 
>> function with information about Linux guest modules.
>> 1. I am unable to put a trace in the R3 code, the code for the VMM / 
>> hypervisor. I am unable to see the LogFlow() messages. Can you help 
>> me enable it ?
>> 2. Is the code that implements page-fusing / sharing in the VMM 
>> specific to windows ?
>> Thanks in advance !
>> _______________________________________________
>> vbox-dev mailing list
>> vbox-dev at virtualbox.org
>> https://www.virtualbox.org/mailman/listinfo/vbox-dev
> 1. Did you take a look at logging information here: 
> https://www.virtualbox.org/wiki/VBoxLogging (see Ring-0 logging)?
> 2. From a quick glance, the guest additions part of the code is 
> specific to Windows, on the host side it is platform agnostic (not 
> enabled for 64-bit darwin hosts though). The guest addition side has 
> some compile-time defines that only register the service hooks for 
> Windows (VBoxService.cpp).
> Regards,
> Ram.
> _______________________________________________
> vbox-dev mailing list
> vbox-dev at virtualbox.org
> https://www.virtualbox.org/mailman/listinfo/vbox-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20121217/8c9a2f0c/attachment.html>

More information about the vbox-dev mailing list