Hi Craig,
On Fri, May 27, 2022 at 11:01 PM Craig Small <csmall@xxxxxxxxxxxx> wrote:
Hi Jan,Yes, this time I checked both versions and in newlib, it's defined the same
Are you looking at the newlib branch or the master one? For clarity, I'm
talking about newlib. I'm also not really sure what you're suggesting needs
changing.
This is not a question of SReclaimable being subtracted from Total in
libproc exposes both MEM_CACHED and MEM_CACHED_ALL with the former being
only what the Cached: line has while the second adds SReclaimable:
free and top use the second value for their cached figures.
We currently have the situation where we have:
Used = Total - Free - Cached - SReclaimable - Buffers
I suggest you also read:
This is the same calculation currently used by the old library.
Yes, I mentioned that in the beginning of the first paragraph of my
https://www.freelists.org/post/procps/OmegaPhilxxxxxxxxxxxxx-Bug799716-free-considers-cached-to-include-SUnreclaim
https://github.com/brndnmtthws/conky/issues/130
Jaromir back in 2014 made a change where Cached got Slabs added to it
(commit 6cb75efef85f735b72e6c96f197f358f511f8ed9), that got fixed in 2015
by me to only include SReclaimable (commit
05d751c4f076a2f0118b914c5e51cfbb4762ad8e).
The Jaromir change is the one Michal is talking about.
The email thread is found at
https://www.freelists.org/post/procps/kb-main-available-etc,14
To me saying X gives me a value of A but Y gives me a value of B is saying
one should change but not one.
If you are after a definition, free(1) has one for you. You first need to
say why these need to change first before we change the code. You need to
say why things were wrong in 2014 or perhaps things have changed since
then. Were you talking with the RedHat kernel team like Jaromir? Can they
explain why they think the change is needed as the 2014 change was partly
informed from that group before.
You won't see that in meminfo.c or vmstat.c, but Shmem page belong to thepage cache and as such are accounted in cached.
If you write a big file in tmpfs, you'll see that both shmem and cacheentry increase
Not all pages in page cache are necessarily reclaimable.reclaimable.
And as far a "used" go, well, that depends on the definition of used.
I'd argue that cache and buffer memory is used, even if easily
I think the important field here is available...
"used" memory is rather imaginatively defined instead of just"
meaning "not free", which is the natural definition. AFAIK, this was
done because people complained that on linux, all their memory was used
by the page cache. But in the end, it seems to have cause more confusion
than anything else.
- Craig