Looking to change value of dom0_mem=max, tried finding xen-cmdline but no luck

36 views
Skip to first unread message

Sphere

unread,
Nov 18, 2019, 10:41:46 PM11/18/19
to qubes-users

So I am looking to reduce the max set on dom0_mem because a considerable amount of ram is being wasted (roughly 1500 MB) and I want to use it on my RAM heavy appvms instead

I've been searching all over the place for xen configuration stuff but I haven't gotten much luck finding anything that has the parameters that define the values in "xen_commandline" that is shown whenever one types xl info

I've tried doing things like "xl mem-set Domain-0 2048M" but it reverts back as soon as I start a new app vm...

Anybody know the proper way to do this?

Andrew David Wong

unread,
Nov 19, 2019, 3:54:57 AM11/19/19
to Sphere, qubes-users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Are you sure that there's actually a problem that needs to be solved
here? A large amount of memory allocated to dom0 does not necessarily
indicate a problem: https://www.qubes-os.org/doc/qmemman/

- --
Andrew David Wong (Axon)
Community Manager, Qubes OS
https://www.qubes-os.org

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEZQ7rCYX0j3henGH1203TvDlQMDAFAl3Trc8ACgkQ203TvDlQ
MDDFZg//SEbcV5taSEX4ft/w2UHs/cI6ZC2Dzc5GrTEF6gcvXz+WGwHcbjpTkuDN
ZF/KR9cDA8a5Sf/CsBTueHv94O9AOCEA6ZPPKkhKIJXQWCEBR/y5NAmU8bJzbweN
d9FA2myxz+k1UXQ6T50qNCilWrZoo2jTSJo3Xt2DiBJOjc0yp+86sThA4kgAkk3L
CA5bgSNfQQPAmQdWIUuu/Z1OWk2U/O1FQDaLP8bdHKNiaQA+hHyq6bhX2s5exbi8
kP7qVGhS3TfPyn71Gz9sU5LSD7orPmNG5ilb77IdZidJU2UjiUWczRFSfJRe3tNG
vsbABDXRrRmxSn1nBVy08iMg7jx5pEcG1t8rCeAG8/82EO78tSpRlHqj6IzfC/qf
fhGxlUSSOoh5++fryhuQeL+h59n42uTZ4cPmj+aeMv0nLodHuRnoGXnAfdbRmpfo
psmE+38nhlqhq9wTEcbmU8jDqhF/pqEm/Fj+QAhC1DCHk+1XECdI9E0nhcAXGl7l
C1J0y3F2Jau8fK9+L9bXKqzLYwyqhvRoe08jeJCxC1izlk9KQnc6Xc6+f+l6fZgw
ahHba1XynL3VswYH59EvwqMtvspGbYGFYvpW0Hy/WHQJGlH1AAHQaBNOo5wQLbzS
bsVjV41UfwAfqSrpcj6fQdC4iY1nARD7hm+hR2BzFlCEIo+teeA=
=MIyF
-----END PGP SIGNATURE-----

Sphere

unread,
Nov 20, 2019, 3:16:12 AM11/20/19
to qubes-users
Well, I do have a problem with AppVMs completely hanging out on me on situations where firefox demands a large amount of ram and these are such cases:
1. Running a resource-intensive web application i.e. node.js web editors like Wix and Weebly
2. Downloading large files from mega.nz (I think the magic here involves loading the file into the RAM after it has been completely downloaded by the browser which is why when the browser prompts saving the file, the process is almost instantaneous... unless you don't have enough RAM to accommodate the demand.
3. Plenty of media-playing tabs open in Firefox or Chrome

There may be other cases that I have forgotten but on all cases where an AppVM froze on me, the total RAM eaten by dom0 hardly ever shrunk for it to be allocated to the AppVM, which should be expected given the existence of https://www.qubes-os.org/doc/qmemman/

I was able to get myself a workaround for the problem before, and that is making more swap, ideally within the 8GB-10GB range.

However, a ram stick just died on me this week and I badly need all the RAM that I could get. Even right now, my dom0 is actively using just about 940 MB worth of RAM... which is why I think it would be best if I could permanently allocate 2048M to dom0 instead of 4096M for my case.

...Not unless there are big security-related reasons as to why 4096M has been the default on dom0.

awokd

unread,
Nov 21, 2019, 2:27:07 PM11/21/19
to qubes...@googlegroups.com
Sphere:

> However, a ram stick just died on me this week and I badly need all the RAM
> that I could get. Even right now, my dom0 is actively using just about 940
> MB worth of RAM... which is why I think it would be best if I could
> permanently allocate 2048M to dom0 instead of 4096M for my case.

/boot/efi/EFI/qubes/xen.cfg

--
- don't top post
Mailing list etiquette:
- trim quoted reply to only relevant portions
- when possible, copy and paste text instead of screenshots

Claudia

unread,
Nov 22, 2019, 11:24:05 AM11/22/19
to qubes...@googlegroups.com
Sphere:
I think you're looking for /boot/efi/EFI/qubes/xen.cfg

I'm not sure if you can change memory limits on dom0 at runtime (i.e.
using xl). Even so, it's not recommended, because the kernel makes
certain decisions based on the amount of memory it sees at boot, such as
size of various memory structures, which are not updated when the amount
of ram changes later. So you could end up with a non-optimal
configuration. It's best to set initial and max memory in xen.cfg.

However I encourage you to read about memory allocation in Xen/Qubes, as
Andrew mentioned, before making any changes, as they might not be
necessary at all.

-------------------------------------------------
This free account was provided by VFEmail.net - report spam to ab...@vfemail.net

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!

Claudia

unread,
Nov 22, 2019, 11:24:23 AM11/22/19
to qubes...@googlegroups.com
Sphere:

> However, a ram stick just died on me this week and I badly need all the RAM
> that I could get. Even right now, my dom0 is actively using just about 940
> MB worth of RAM... which is why I think it would be best if I could
> permanently allocate 2048M to dom0 instead of 4096M for my case.
>
> ...Not unless there are big security-related reasons as to why 4096M has
> been the default on dom0.
>

I think you're looking for /boot/efi/EFI/qubes/xen.cfg line
"options=..." (UEFI) or /etc/default/grub line "GRUB_CMDLINE_XEN=..."
(legacy, or UEFI+grub).

I have no idea if it's effective, advisable, or safe; I'm just
explaining how to do it if you want to.

https://wiki.xenproject.org/wiki/Xen_Project_Best_Practices#Xen_Project_dom0_dedicated_memory_and_preventing_dom0_memory_ballooning

https://wiki.xenproject.org/wiki/Xen_Project_Best_Practices#Why_should_I_dedicate_fixed_amount_of_memory_for_Xen_Project_dom0.3F

Sphere

unread,
Nov 23, 2019, 12:28:26 AM11/23/19
to qubes-users
@awokd: What on earth, so I was almost there already
I was looking around grub and grub2 folders in hopes of finding some sort of startup script related to it. Now I feel so dumb hahahahahaha
Many Thanks!

@Claudia: Thanks for the heads' up. I have set the max memory through xen.cfg for my situation.
To be honest, I couldn't comprehend completely the memory allocation in Xen/Qubes article but if I understand it right, what it heavily implies is that dom0 dynamically allocates memory from itself to AppVMs when it sees that there is a need for it. I did observe this behavior to some extent but unfortunately, it doesn't seem to react when an AppVM is in a very near-frozen state due to lack of RAM to use. I have observed this for almost over 5 times already and it sucked.

Also, I could observe some minor lag hiccups whenever the browser is starting to completely exhaust the ram available to the AppVM, and that is something I would like to try to avoid.
Reply all
Reply to author
Forward
0 new messages