Re: Enable EarlyOOM on Fedora KDE - Fedora 33 Self-Contained Change proposal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2020-07-14 at 00:55 +0900, Alexey A. wrote:
> > MemAvailable is a bad heuristic, it does *not* represent "free"
> > memory.
> 
> 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.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux