On 09/02/2012 11:20 PM, Yu Mingfei wrote:
On 31/08/12 22:57, Chris Evich wrote:
On 08/30/2012 05:39 AM, Yu Mingfei wrote:
>> ...
23168 KB difference. Is it the same difference always, or does it
change with setmem?

I wonder if we can account for this easily. I'll ask KVM developers if
they know why it's different and/or if they have suggestion to count
it. If not, then probably checking delta is most practical possible
alternative.
Ok, I 'm expecting their answer.:-)
Because I never find that inside size is equal to outside size.:-(

I made some progress here as apparently this is a frequently asked question. The difference is simply in how the guest chooses to utilize (or not) available memory. The host has no idea what's used, unused, lost, or stolen. i.e. If for whatever reason, the guest doesn't use/report every byte the host has no idea. The host still has to keep track of the unused portion regardless.

So, what I would say is the memory reported from the host side is always correct. The amount reported on the guest side will deviate depending on the guest (kernel version, virtual bios, etc.). Given the impossibility of accounting for all guest types, I think using a 'delta' value is making the best of a less than ideal situation.

The test can also check that guest-side memory is always reported as less-than or equal-to host-side memory. I'd recommend checking with several different guest types (Linux vs Windows too), and see what the reporting range is. Perhaps also setting guest memory really low and checking with memtest86 or similar tool.

Maybe we can come up with an approximation of appropriate delta values, across a range of assigned memory quantities. For example, the delta is probably different % for a 128M memory guest versus a 4G memory guest. Maybe the test starts with a delta of 15% for guests smaller than 128M, then drops 1% delta for every 512M of guest memory, down to a floor value of (guessing) 1%. Just a suggestion.

---

In case your interested in tracking this down further on the libvirt side, here's the entry point:

http://libvirt.org/git/?p=libvirt.git;a=blob;f=src/libvirt.c;h=b034ed6fe12ea34cdbcf5cf34aae6434523aff11;hb=HEAD#l7380

(see where it's dependent on the driver?)

--
Chris Evich, RHCA, RHCE, RHCDS, RHCSS
Quality Assurance Engineer
e-mail: cevich + `@' + redhat.com o: 1-888-RED-HAT1 x44214

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to