-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport the new slightly different algorithm for "MemAvailable" used by Linux kernel 4.8+ #2
Comments
I have no idea where this 1% error comes. It could be that not all counters in "/proc/meminfo" are updated at the same time atomically. Can I see the whole output of your "/proc/meminfo"? |
|
I think I know why: Linux kernel changed the way this is calculated.
Whereas (recent) Linux kernels do Not sure how to get |
...and this is where the change got introduced: |
This is how total reserve pages are calculated: |
Also |
Giampaolo, thank you for the thorough research. Now we know the cause of the issue and how the current Linux implementation works. Unfortunately, I lack the knowledge of how to calculate "total_reserved_pages" from the info exported in "/proc". I'll leave this case opened. Maybe someone else could give us a hint. |
I think all the info is exposed on /proc/zoneinfo Check this example of file with the relevant fields annotated at the right: http://sprunge.us/EZba I think is a matter of iterating over the zones. The values for lowmem_reserve on each zone seem to be printed inside the |
@clopez thanks for the hints. I've backported the new Linux kernel implementation. Guys, please test "free.pl" now and re-open this ticket by providing additional debug info if there is still a problem. |
@famzah I would be interested in doing the same in psutil. I don't know Perl so it's hard for me to understand what you did in there. Could you explain the logic you used with some pseudo code or something? |
I'll try to explain the whole commit cfb776d:
|
On Ubuntu 16.04 (kernel 4.0.0.36) the "avail" value differs from system's by about 90M.
At first I thought it was the Perl interpreter overhead but I tried running "cat /proc/meminfo |grep Avail" from the shell script as a subprocess and I get a similar result.
Any idea?
The text was updated successfully, but these errors were encountered: