-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Wed, Feb 06, 2019 at 02:17:17PM -0500, Chris Laprise wrote:
> On 2/6/19 1:07 PM, Marek Marczykowski-Górecki wrote:
> > (*) Actually there are two parts of this: first detecting that qube
> > needs more RAM - it is reported with 10Hz frequency, as a trade-off
> > between allocation speed and system load caused by qmemman itself.
> > Secondly, it needs some time to actually get this memory, potentially
> > reclaiming it from other qubes first.
> 
> There seems to be a fundamental flaw in this asynchronous method. Basically,
> we have a race condition where the delays incurred by swap are used to buy
> time for qmemman.
> 
> If I were more familiar with the subject, I might propose a memory
> allocation method that is synchronous and therefore more deterministic.

Such deep integration, while may help in some corner cases (rapid, large
allocations), I think it will overall reduce performance in most common
cases (not so rapid memory allocations). Adding synchronization to
memory allocation, would make it slower, including common use cases.
Qmemman, also try to maintain 30% margin of free memory inside each VM
(configurable in /etc/qubes/qmemman.conf), so it isn't only swap used
to buy some time.
Also note that VM have no guarantee it will get that memory (especially
if it's already at its maxmem), so need to be prepared to deal with such
cases too.

Linux memory subsystem generally works better if there is _some_ swap.
It is used for example to keep memory pages that process do not use for
a while (especially useful if application have some memory leaks, which
is unfortunately not that rare...).

Anyway, if you have some process rapidly requiring a lot of RAM, it may
be better to disable memory balancing for that qube, regardless if it's
fast enough or not. Constantly reassigning large amount of memory will
take some CPU time, that could be spent on the process itself otherwise.
For example we recommend disabling it for building Qubes OS ISO, here:
https://www.qubes-os.org/doc/qubes-r3-building/

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----

iQEyBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAlxbOWoACgkQ24/THMrX
1yx+nAf3Yy/CCjmpWs5gqcMGkMxrlDQp5lxQb32y+zAqGZ2L7e+in5KouXqXyP0z
CT4k4vb1c+f/poNaeooyEzazUca4Q+Ck6WRb5Hli1h54XbogNR3dbmX9xlXBI/cH
i+SGWPbAt+Wm8LWCn7k25Z45jYnSBD04t0m/EG0UmKG+YfdH9T/8aSxbAeSimhed
9Fj/6dyyHjRZLWucEwQ2vQVTD5/fJOHIAnfAXxUXjE+EjX1q++GX+jyVINwpHWBA
toBw77b4chHmF7G+auQgvTUQeDeOaTxARY2S6Obmpr+DXjP08gYl8d8teCosYlYt
ifykmxhleUqaT8VI6kanAMXWzrHC
=QoEb
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/20190206194546.GU21228%40mail-itl.
For more options, visit https://groups.google.com/d/optout.

Reply via email to