HackerTrans
トップ新着トレンドコメント過去質問紹介求人

man8alexd

127 カルマ登録 10 か月前

投稿

The CRA and what it means for us (Kernel Recipes 2025) [video]

youtube.com
1 ポイント·投稿者 man8alexd·9 か月前·1 コメント

コメント

man8alexd
·6 日前·議論
Why do you think it is a better default? What does it solve?
man8alexd
·6 日前·議論
You have a lot of unused anonymous memory that is better swapped out and used as a file cache. Specifically for Linux swap, see https://chrisdown.name/2018/01/02/in-defence-of-swap.html
man8alexd
·7 日前·議論
You can't fix the fact that you can't predict the future. The software will always allocate more memory than it needs because it can't predict its future resource usage, so limiting memory allocation with strict overcommit is meaningless.
man8alexd
·7 日前·議論
About shared memory included in the memory size calculations https://lkml.iu.edu/1902.2/05674.html
man8alexd
·7 日前·議論
The kernel keeps track of active/inactive pages by scanning page tables during the reclaim process. It only scans until it finds enough inactive pages to reclaim. Scanning all pages all the time is very expensive from a performance point of view.
man8alexd
·8 日前·議論
OOM is better. If a program doesn't handle ENOMEM properly, then its state is unpredictable and can lead to data corruption.
man8alexd
·8 日前·議論
Linux MemAvailable from /proc/meminfo is just an estimation calculated as an arbitrary percentage (50%) of free and potentially reclaimable memory.

You can't determine how much of the memory can actually be reclaimed under memory pressure until you try to reclaim it.
man8alexd
·8 日前·議論
There is no point in managing memory allocations as they have little relation to actual memory usage. There are also other methods than the OOM killer to handle OOM, like process throttling using cgroups "memory.high" limits.
man8alexd
·8 日前·議論
In this specific case, the correct behaviour would be to drop a part of the buffer pool until the memory pressure is gone. The context-dependent question is how much and how fast to drop. The current implementation drops to a single configurable level but I suspect it could have implemented better heuristics.
man8alexd
·8 日前·議論
Because no one can predict the future, and they don't know how many resources they will need.
man8alexd
·8 日前·議論
Maybe you should skip running a useless child process and just use PSI to monitor memory pressure.
man8alexd
·8 日前·議論
You can always tell the system not to kill your Photoshop (or whatever else) by setting the OOM Score Adjust. This mechanism has existed for almost two decades and systemd has supported it for over a decade.
man8alexd
·8 日前·議論
You will be surprised by how inaccurate memory measurements are.
man8alexd
·8 日前·議論
See this retrocomputing.SE question https://retrocomputing.stackexchange.com/questions/32492/ori...
man8alexd
·8 日前·議論
FreeBSD didn’t have memory overcommit and instead used strict swap reservation - each allocated anonymous memory page was supposed to have a corresponding swap page. This required 2x RAM swap space, otherwise you would get “out of swap” when forking a large process. FreeBSD implemented memory overcommit around 2000.
man8alexd
·8 日前·議論
No, it doesn't handle failing allocations gracefully - https://unix.stackexchange.com/questions/797841/firefox-died...
man8alexd
·9 日前·議論
Is Firefox low quality?
man8alexd
·9 日前·議論
People like to reinvent things that they are not aware of. Original BSDs used to use strict swap reservation - every anonymous memory page had to have an associated swap page. You had to have the swap 2x of RAM to allow large processes to fork - otherwise you would get an "out of swap" error. FreeBSD implemented overcommit around 2000, I think version 4.x or 5.x.
man8alexd
·9 日前·議論
MariaDB recently implemented memory PSI monitoring but failed with that in a curious way and disabled it afterwards by default. The failure is that under memory pressure, they flushed the entire InnoDB buffer pool.
man8alexd
·9 日前·議論
The last paragraph:

> On the modern desktop, where programmers don't care about failing malloc(), disabling overcommit is shooting yourself in the foot. As you can observe, the memory allocations start failing long before the memory is exhausted.