1

Many of the kernel parameters have default values assigned. But some of them aren't really clear. I'm reading the proc manual and in the case of admin_reserve_kbytes we can read the following:

The default value in this file is the minimum of [3% of free pages, 8MiB] expressed as KiB.

There are other similar default values, so what does this mean?

3

Some time during kernel boot - when the MM subsystem is initialized - it calculates 3% of the remaining free memory. If that is more than 8MiB, the value is set to 8MiB. Hence we say the value is set to the minimum of the two. This is a one-time initialization; it is never re-calculated.

https://elixir.bootlin.com/linux/v5.0/source/mm/mmap.c#L3666

The value of the sysctl is a number. It is not a number of bytes; it is a number of "KiB". 1 KiB is 1024 bytes. It is the closest number to 1000, that is a convenient power of 2. RAM chips are built in powers of 2. (Also, we can multiply or divide powers of 2 using a fast binary shift operation).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.