After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727543 - Use Linux 3.14.0 MemAvailable
Use Linux 3.14.0 MemAvailable
Status: RESOLVED FIXED
Product: libgtop
Classification: Core
Component: linux
2.28.x
Other Linux
: Normal enhancement
: ---
Assigned To: libgtop maintainers
libgtop maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-03 13:16 UTC by Benoît Dejean
Modified: 2015-07-14 16:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set glibtop_mem::user to 'MemFree - MemAvailable' starting from Linux 3.14.0 (629 bytes, text/x-po)
2014-04-03 13:16 UTC, Benoît Dejean
  Details
Use MemAvailable (1.24 KB, patch)
2014-04-14 07:41 UTC, Benoît Dejean
committed Details | Review

Description Benoît Dejean 2014-04-03 13:16:25 UTC
Created attachment 273527 [details]
Set glibtop_mem::user to 'MemFree - MemAvailable' starting from Linux 3.14.0

Hello,

a long time ago, when I added the member 'user' to the glibtop_mem struct, my intent was to supply a value that would represent the memory used by userspace. Before that, system-monitor was simply using 'used' and 'free' and because of the kernel caches, the memory usage was always reported > 90% which scared users (Windows Vista/7/etc lusers experienced the same misunderstanding years later). So back then, I added that 'user' member that would hide in libgtop/linux the 'free + cache + buffer' instead of the #ifdef __linux__ in system-monitor.

Linux 3.14 now provides a "MemAvailable" field as described in https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/fs/proc/meminfo.c?id=34e431b0ae398fc54ea69ff85ec700722c9da773 which has a the same philosophy: provide a sensible number of how much memory is available to application.

So please find attached a simple patch to computer 'user' as 'free - MemAvailable' for Linux >= 3.14.

On my newly booted system, you can see the difference:
    Linux powerbook 3.14.0ben #1 SMP Thu Apr 3 09:17:44 CEST 2014 x86_64 GNU/Linux
    user new-style : 969MiB
    user old-style : 663MiB
Comment 1 Benoît Dejean 2014-04-14 07:41:22 UTC
Created attachment 274232 [details] [review]
Use MemAvailable

Same as a git patch.
Comment 2 Benoît Dejean 2015-07-14 16:18:16 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release. You may need to upgrade your Linux distribution to obtain that newer version.
Comment 3 Benoît Dejean 2015-07-14 16:23:21 UTC
Review of attachment 274232 [details] [review]:

Commited.