manager/qubesmanager
Victor Lopez 473b822e0c Linux VM specific: force minimum init mem to allow scaling up memory
Check init_mem and max_mem_size in a single function (merging the
previous two) taking into account the minimum init memory that allows
the requested maximum memory.

Explanation:
Linux kernel needs space for memory-related structures created at boot.
If init_mem is just 400MB, then max_mem can't balloon above 4.3GB (at
which poing it yields "add_memory() failed: -17" messages and apps
crash), regardless of the max_mem_size value.

Base of Marek's findings and my tests on a 16GB PC, using several
processes like:
   stress -m 1 --vm-bytes 1g --vm-hang 100

result in the following points:
init_mem  ==> actual max memory
400             4300
700             7554
800             8635
1024            11051
1200            12954
1300            14038
1500            14045 <== probably capped on my 16GB system

The actual ratio of max_mem_size/init_mem is surprisingly constant at
10.79

If less init memory is set than that ratio allows, then the set
max_mem_size is unreachable and the VM becomes unstable (app crashes)

Based on qubes-devel discussion titled "Qubes Dom0 init memory against
Xen best practices?" at:
https://groups.google.com/d/msg/qubes-devel/VRqkFj1IOtA/UgMgnwfxVSIJ
2014-10-06 04:00:20 +02:00
..
__init__.py Initial public commit. 2010-05-11 16:54:35 +02:00
.gitignore gitignore 2012-07-05 00:47:05 +02:00
appmenu_select.py *.py: Use full paths when calling subprocess.Popen(). 2014-05-22 15:07:35 +02:00
backup_utils.py *.py: Use full paths when calling subprocess.Popen(). 2014-05-22 15:07:35 +02:00
backup.py *.py: Use full paths when calling subprocess.Popen(). 2014-05-22 15:07:35 +02:00
block.py block: fix attaching r/o devices (cdrom for example) 2014-07-08 02:06:35 +02:00
create_new_vm.py create-vm: Handle the case when no HVM-template exists 2014-06-07 04:40:24 +02:00
firewall.py firewall: add an option to temporary allow full network access (#760) 2014-03-28 06:41:35 +01:00
global_settings.py *.py: Use full paths when calling subprocess.Popen(). 2014-05-22 15:07:35 +02:00
log_dialog.py log_dialog: display only last 1MB of log, force it plain text 2014-05-05 02:15:01 +02:00
main.py use new icon from qubes-artwork 2014-07-09 18:21:56 +02:00
mount_for_backup.sh Remove trailing semicolons 2014-02-23 00:44:08 +01:00
multiselectwidget.py Remove trailing semicolons 2014-02-23 00:44:08 +01:00
restore.py backups/restore: always allow an option to manually unmount storage device 2014-09-26 15:01:37 +02:00
settings.py Linux VM specific: force minimum init mem to allow scaling up memory 2014-10-06 04:00:20 +02:00
table_widgets.py use new padlocks from theme 2014-07-10 16:50:29 +02:00
thread_monitor.py use any python2, not explicit python2.6 2013-01-23 15:55:14 +01:00