[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fedora-devel-list
Subject:    Re: Enable EarlyOOM on Fedora KDE - Fedora 33 Self-Contained Change proposal
From:       Benjamin Berg <bberg () redhat ! com>
Date:       2020-07-13 18:00:34
Message-ID: c62becea93c8254c59d497b40f9e19a5e486aabd.camel () redhat ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Tue, 2020-07-14 at 00:55 +0900, Alexey A. wrote:
> > MemAvailable is a bad heuristic, it does *not* represent "free"
> > memory.
>=20
> MemAvailable is a good  heuristic, it does represent available
> memory.

Maybe. But the point is that I expect a system to be in trouble long
before the value of MemAvailable approaches zero.

In the end, it will depend on the workload. MemAvailable basically
assumes that half of the file cache (plus some other reclaimable
memory, see si_mem_available in linux/mm/page_alloc.c) can be safely
used for other purposes.

A good chunk of what MemAvailable shows will be
 `MemFree + (Active(file) + Inactive(file) + SReclaimable) / 2`
(there is more added, but that just helps the argument)

If MemAvailable drops below 250MiB (roughly 6GiB * 4%), then this means
that we have less than 500MiB left for file caches. If we can't swap
(remember, swap is already pretty full too), then a big chunk of these
caches need to be dropped to make the memory available to applications.

But this is the problem. You need a good amount of file caches for a
system to function properly. The kernel can *run* with that little
memory, but your system will likely start to thrash eventually. Which
is exactly what we are trying to prevent here.


So, I think calling this "available" or "free" memory is really
misleading. Because, what we you are essentially doing with EarlyOOM is
ensuring that there is enough space available for (file) caches[1].

Basically, I think you could turn it around and translate the 4% to
mean "reserve ~8% of system memory to be used for essential caches".

Benjamin

[1] And yeah, you'll be able to construct workloads that only require a
few MiB of file backed data.

["signature.asc" (application/pgp-signature)]
[Attachment #6 (text/plain)]

_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic