-
Notifications
You must be signed in to change notification settings - Fork 0
Home
The provided patch creates a new QMP (Qemu Monitoring Protocol) command named query-dirty-pages
, it allows to measure and retrieve the amount of memory dirty pages of a VM through a dedicated Qemu thread.
The command can be then executed using the Livirt cmdline tool virsh
using the qemu-monitor-command
option.
There are currently 3 versions of the patch located in different branches:
-
2.4.50
: latest version in date based on qemu version 2.4.50, commit 496c1b1 (05/11/15). -
ucc-15
: version used for experiments in the paper entitled "Scheduling Live-Migrations for Fast, Adaptable and Energy Efficient Relocation Operations" published in UCC'15 conference. -
vhpc-14
: version used for experiments in this paper published in VHPC'14 workshop.
Retrieve and compile the desired version (example using ucc-15
branch):
git clone -b ucc-15 --single-branch --depth 3 git@github.com:btrplace/qemu-patch.git
cd qemu-patch
./configure --target-list=x86_64-softmmu
make
Note: To have a look at the changes, check the patch named "0001-..." at the root of each branch.
For example, there is the patch used for ucc-15
.
You'll then need to compile libvirt too => https://libvirt.org/compiling.html#building.
The new QMP command is named query-dirty-pages
, it takes 4 arguments as parameters:
-
file
: (mandatory argument) represents the full path of the output file that will be created (root owner) on the host filesystem. -
freq
: (mandatory argument); indicates the frequency in milliseconds of each dirty pages record. By default the command provides a single record at t=freq
ms. -
delay
: (default:freq
); the total duration of the operation in milliseconds. For example iffreq
=50 anddelay
=100, you'll get two consecutives records in the output file. -
clear
: (default:true
); indicates if the amount of dirty pages must be cleaned/reset after each record.
Retrieve the amount of memory pages dirty in 30 ms:
virsh -c qemu+tcp://<server>/system qemu-monitor-command <domain> '{ "execute": "query-dirty-pages", "arguments": { "file": "/tmp/output_file", "freq": 30 } }'
Now, the same thing but repeated during 1 sec. (20 records):
virsh -c qemu+tcp://<server>/system qemu-monitor-command <domain> '{ "execute": "query-dirty-pages", "arguments": { "file": "/tmp/output_file", "freq": 30, "delay": 1000 } }'
In this example, the underlying memory dirty bitmap is automatically cleaned every freq
milliseconds, it should thus output very similar results. This can be used for example to compute the average amount of memory pages that get dirty under 30 ms.
Here, the clear
parameter is set to false
, which means that the memory dirty bitmap is only clean at the beginning and the end of each record:
virsh -c qemu+tcp://<server>/system qemu-monitor-command <domain> '{ "execute": "query-dirty-pages", "arguments": { "file": "/tmp/output_file", "freq": 30, "delay": 1000, "clear": false } }'
This will give you a good idea of the overall dirty pages progression.
In the given examples, the output file /tmp/output_file
is created on the host of the tageted VM.
The output file is a Comma Separated Values (CSV) file format, there is how it looks like :
- By clearing the dirty pages each
freq
ms:
Round:<n>,freq:<frequency>,pages:<amount of pages>,bytes:<total size of pages>
- By summing the pages (
clear:false
):
Round:<n>,total_time:<in ms>,total_pages:<amount of pages>,total_bytes:<size of pages>