|
From: | Avi Kivity |
Subject: | [Qemu-devel] Re: virtio: Report new guest memory statistics pertinent to memory ballooning (V4) |
Date: | Thu, 19 Nov 2009 18:02:31 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Thunderbird/3.0b4 |
On 11/19/2009 05:56 PM, Adam Litke wrote:
On Thu, 2009-11-19 at 17:19 +0200, Avi Kivity wrote:On 11/19/2009 05:06 PM, Adam Litke wrote:Avi and Anthony, If you agree that I've addressed all outstanding issues, please consider this patch for inclusion. Thanks.I'd like to see this (and all other virtio-ABI-modifying patches) first go into the virtio pci spec, then propagated to guest and host.Where can I find information on the procedure for updating the virtio pci spec?
Send a patch to Rusty (same copy list). http://ozlabs.org/~rusty/virtio-spec/
Changes since V3: - Increase stat field size to 64 bits - Report all sizes in kb (not pages)Why not bytes? It's the most natural unit.The precision for most of these stats (except major and minor faults) is 4kb (at least for Linux guests on the platforms I can think of). I chose kb units to avoid wasting bits. I suppose the 64bit fields are "Bigger than we could ever possibly need (tm)". Others have suggested bytes as well so I will be happy to make the change.
It's my engineering backgrounds. I'd actually prefer them in a kg/m/s combo but it doesn't really work out.
-static ram_addr_t virtio_balloon_to_target(void *opaque, ram_addr_t target) +static void request_stats(VirtIOBalloon *vb) +{ + vb->stats_requested = 1; + reset_stats(vb); + monitor_suspend(cur_mon);You allow the guest to kill a monitor here.Is there a better way to handle asynchronous communication with the guest?
With the current monitor, the only option I can think of it a command to request stats and a command to report stats (with a version number so we can see if it actually worked).
The new monitor will support async command completion but even then I don't think we should allow a guest to stop command execution indefinitely (it would tie up resources at the client).
+typedef struct VirtIOBalloonStat { + uint16_t tag; + uint64_t val; +} VirtIOBalloonStat;Alignment here depends on word size. This needs to be padded to be aligned the same way on 32 and 64 bit hosts and guests.ok. I assume that means the structure size must be a multiple of 64 bits in size
Yes, and all values must be naturally aligned. -- error compiling committee.c: too many arguments to function
[Prev in Thread] | Current Thread | [Next in Thread] |