Commit Graph

79 Commits

Author SHA1 Message Date
Rafal Wojtczuk
885d747272 qmmemman: force static_memory_max to be as much as total RAM
Not including netvm, it causes some issues with it.
2010-09-20 11:24:56 +02:00
Rafal Wojtczuk
c411519220 qmemman: do not trim the mem-set value too much
We used to mem-set the domain to 0.995*calculated_value; 5 promils of 4GB
is ca 19MB, and it is too visible. Use 0.999 instead of 0.995
2010-09-16 16:40:09 +02:00
Rafal Wojtczuk
eea01fba3b qmemman: in is_balance_req_significant(), account for Xen free memory 2010-09-16 16:00:07 +02:00
Rafal Wojtczuk
e476531b0e Leave XEN_FREE_MEM_LEFT of Xen free memory.
Needed for driver domain, to be able to get contiguous memory for
its drivers.
2010-09-16 15:57:11 +02:00
Rafal Wojtczuk
0c1f21a28e qmemman: when a AppVM is low on memory, allow small adjustments
A small AppVM (say, with 100MB total) can go below prefmem, and
still not be assigned memory, because of the MIN_TOTAL_MEMORY_TRANSFER
threshold.
So, if AppVM is below prefmem, allow for smaller mem-sets.
2010-09-10 11:35:30 +02:00
Rafal Wojtczuk
f6e3607d2d qmemman: offload some processing to meminfo-writer
Make meminfo-writer compute used memory, and report to qmemman only if
it has changed significantly enough. As it is written in C, its code is
much faster that qmemman-server; also in the idle case, it saves on xenstore
communication overhead. Allows to send updates up to 10 times per second,
with CPU load on the VM below 0.1%.
2010-09-09 17:51:53 +02:00
Rafal Wojtczuk
51e14fc8bb qmemman: trigger do_balance() on receiving /proc/meminfo data 2010-09-09 12:36:18 +02:00
Rafal Wojtczuk
f4e46b63a4 qmemman: in client code, set FD_CLOEXEC on qmmemman.socket 2010-09-09 12:33:48 +02:00
Rafal Wojtczuk
7545789a26 qmemman: now parse_meminfo takes a single argument 2010-09-09 11:30:02 +02:00
Rafal Wojtczuk
9c609a23bf qmemman: move /proc/meminfo parsing to qmemman_algo
Just cosmetics, to make code layout more coherent.
2010-09-09 11:24:04 +02:00
Rafal Wojtczuk
24b3baf063 qmemman: use 'Memtotal' from /proc/meminfo to calculate used memory
Previously, memory_actual (retrieved from xen) was used; it can be inconsistent.
'Memtotal' can be spoofed, but anyway we rely on other fields from /proc/meminfo.
2010-09-09 11:08:20 +02:00
Rafal Wojtczuk
5a33ed71ce qmemman: use the fact that balloon driver retries
Apparently even if there is not enough xen memory to balloon up,
balloon driver will try to fulfill the request later, when
some memory is freed. Thus, in do_balloon, do not limit mem_set
to the available memory.
2010-09-09 10:36:13 +02:00
Rafal Wojtczuk
87d1e973c7 qmemman: print balance stats only when updating 2010-09-09 10:29:35 +02:00
Rafal Wojtczuk
5be12f8459 qmemman: switch off memory balancing when doing xm save
Apparently, it interferes:
INFO (XendCheckpoint:417) ERROR Internal error: Could not get vcpu context
INFO (XendCheckpoint:417) ERROR Internal error: Failed to map/save the p2m frame list
2010-09-07 16:00:14 +02:00
Rafal Wojtczuk
11abef3439 qmemman: xc.domain_set_target_mem can throw exceptions, too 2010-09-07 13:10:48 +02:00
Rafal Wojtczuk
22df517425 qmemman: detect domain list change by watching /vm, not /local/domain
The latter triggers on every memory/meminfo key update, which needlessly
adds xenstore requests.
2010-09-06 10:46:36 +02:00
Rafal Wojtczuk
7dcb7cb196 qmemman: don't use xenapi, use hypercalls to do mem-set 2010-09-03 16:19:48 +02:00
Rafal Wojtczuk
10408d61db qmemman: when low on memory, do not make a VM go below prefmem
Now the balance() has two different cases: enough memory and low_on_memory.
In the former, distribute memory proportianally; in the former, dont do this, as this
makes a VM go below prefmem.
2010-09-01 12:40:02 +02:00
Rafal Wojtczuk
80771763cf qmemman: limit total memory transfer, not each one 2010-09-01 10:39:39 +02:00
Rafal Wojtczuk
c66e0848f3 qmemman: limit domain memory to 2G to workaround for xen xml-rpc limitation
File "/usr/lib64/python2.6/xmlrpclib.py", line 710, in dump_int
    raise OverflowError, "int exceeds XML-RPC limits"
OverflowError: int exceeds XML-RPC limits
How crappy.
2010-08-31 16:19:01 +02:00
Rafal Wojtczuk
de2619fbed qmemman: wrap xenapi.memset within try/except
It can fail e.g. when a domain is being shutdown with a pretty
message like
 File "/usr/lib64/python2.6/site-packages/xen/xend/XendDomainInfo.py", line 1322, in setMemoryTarget
    (target * 1024))
Error: (1, 'Operation not permitted')
2010-08-31 15:53:24 +02:00
Rafal Wojtczuk
eb6755e93c qmemman: fix locking
We want balance() to wait on a lock even after balloon() has finished,
until socket client has closed.
2010-08-30 14:50:48 +02:00
Rafal Wojtczuk
2eba4c1c15 I will test before commit. I will test before commit. I will... 2010-08-30 12:01:42 +02:00
Rafal Wojtczuk
f3561b7aad Fix restore completion detection in appvm/qubes_core 2010-08-30 11:43:30 +02:00
Rafal Wojtczuk
62487c0f1e Memory management across VMs, first release 2010-08-30 11:40:19 +02:00
Joanna Rutkowska
4d26334709 dom0/init.d/qubes_core: set Dom0 mem to 1600M 2010-07-30 16:00:18 +02:00
Joanna Rutkowska
557984f4b9 minor ident fixes 2010-07-30 15:59:43 +02:00
Rafal Wojtczuk
4cf0a61858 Before restoring DVM, check for available xen memory
As we already do xm mem-set 0 800 in qubes_core, this is a
correct check. Now, there should be no errors from qubes_restore
in normal circumstances.
2010-07-27 16:08:09 +02:00
Joanna Rutkowska
3856f7cdbd qvm-create-default-dvm: use gray label for dvm-template (be consitent with VM template label) 2010-07-27 12:47:18 +02:00
Rafal Wojtczuk
b578aab5d5 qubes_prepare_saved_domain.sh: Check exit code of xm save 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
aa894b5700 qvm-create-default-dvm script 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
d46bf2a270 Pathnames cleanup
Move internal scripts to /usr/lib/qubes plus a couple of similar.
2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
11b8a0409f DVM: execute user script before save
qubes_prepare_saved_domain.sh now takes optional second argument, the
filename. The content of the file will be copied (via xenstore) to DVM
and executed just before save. This makes it possible to preload memory
with useful apps.
2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
0c0f34ba9b DVM: manage savefiles
Instead of hardcoded savefile name, use a symlink in
/var/run/qubes. Tools should set this symlink to a correct
savefile. Also, test whether the savefile is older than the
template root.img.
2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
6ee594f972 Update qubes.xml with DVM
Also, pass correct parameters to DVM's qubes_guid (taken from
qubes.xml).
2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
e1320483f9 qfilexchgd: handle 'killme' command 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
0c122f670e qfilexchgd: pass correct transaction_seq for delayed transaction 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
203b3fd70b dvm: reserve a bit more ram in dom0 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
2e927cce68 dvm: correct PATH and permissions 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
c71a1694d2 Make the message about DVM creation failure more verbose 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
a343272481 Make br0 forward traffic delay short 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
d93e6dd86b add syslog.h to qubes_restore.c 2010-07-21 12:57:02 +02:00
Rafal Wojtczuk
c05911a01e qfilexchgd fixes
kill dvm after is has sent an answer
set transaction_seq to 0 for normal transfers
qfilexchgd mode:=755
2010-07-21 12:56:43 +02:00
Rafal Wojtczuk
0dbef3f2ae dvm: appvm side code 2010-07-21 12:56:43 +02:00
Rafal Wojtczuk
08d3082cf3 qfilexchgd code for disposable VM 2010-07-21 12:56:43 +02:00
Rafal Wojtczuk
793b7b2596 Quick VM restore support 2010-07-21 12:56:21 +02:00
Joanna Rutkowska
8c4ac4326f pm-utils: 01qubes-sync-vms-clock: cosmetic fix for nicer output 2010-07-08 12:45:33 +02:00
Joanna Rutkowska
c8ef500588 Pause/Unpause all running VMs on system suspend/resume
This is to fix the VM lockup problem on HT processors that
occured after S3 resume (see ticket #52).

The qvm-run command now takes additional two switches:
--pause
--unpause
2010-07-08 12:41:29 +02:00
Joanna Rutkowska
c2826ec0c4 Make qubes-testing repos disabled by default 2010-07-06 16:35:10 +02:00
Joanna Rutkowska
115df6f1af Dom0: sync wallclocks in all vms upon resume from S3 sleep
This is really a workaround, until Xen implements proper suspend/resume
mechanism for notfying DomUs about system-wide S3 sleep.

See this thread for more details:

http://lists.xensource.com/archives/html/xen-devel/2010-07/msg00037.html
2010-07-06 16:32:50 +02:00