Skip to content

Commit

Permalink
Fix initial value of dom0 static-max entry
Browse files Browse the repository at this point in the history
This value needs to be set to actual static max for qmemman to work
properly. If it's set higher than real static-max, qmemman will try to
assign more memory to dom0, which dom0 could not use - will be wasted.
Since this script is executed before any VM is started, simply
take the current dom0 memory usage, instead of parsing dom0_mem Xen
argument. There doesn't seem to be nice API to get this value from Xen
directly.

Fixes QubesOS/qubes-issues#4891

(cherry picked from commit 56ec271)
  • Loading branch information
marmarek committed May 6, 2019
1 parent 3c66061 commit c796883
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linux/aux-tools/startup-misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Misc dom0 startup setup

/usr/lib/qubes/fix-dir-perms.sh
DOM0_MAXMEM=`/usr/sbin/xl info | grep total_memory | awk '{ print $3 }'`
DOM0_MAXMEM=$(/usr/sbin/xl list 0 | tail -1 | awk '{ print $3 }')
xenstore-write /local/domain/0/memory/static-max $[ $DOM0_MAXMEM * 1024 ]

xl sched-credit -d 0 -w 2000
Expand Down

0 comments on commit c796883

Please sign in to comment.