Wednesday 8 December 2021

Re: Revisiting default initramfs compression

On Wed, Dec 08, 2021 at 06:12:43PM +0100, Julian Andres Klode wrote:
> Question: Does zstd --adapt adapt to memory available?

"memory available" is very difficult to actually determine:
- is it physical memory on the machine?
- is it physical memory reported as "free" in /proc/meminfo?
- is it physical memory reported as "available" in /proc/meminfo?
- do you count memory used for buffers and caches as free?
- do you count memory available via swap as free?
- are there rlimits in place on the process that limit how much it can
allocate?
- are there cgroup controls in place on the process that limit how much it
can allocate?
- is this process the only meaningful process at the time? or are there
other processes on the system that are more important?

I haven't actually looked to see if zstd tries to figure out how much
memory is free -- maybe it does, maybe it doesn't -- but I'd be worried
that relying upon it to do the right thing wouldn't work well for the
general case.

Thanks