]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Stop computing a "sharedram" value when emulating Linux sysinfo(2).
authorMark Johnston <markj@FreeBSD.org>
Mon, 8 Jun 2020 22:29:52 +0000 (22:29 +0000)
committerMark Johnston <markj@FreeBSD.org>
Mon, 8 Jun 2020 22:29:52 +0000 (22:29 +0000)
commit3e5fae34fc49099effbd315f053841392da0f026
treee69cc967e9344afd1c7af0f76030c2000920a235
parent8c3988dff98e6da1c1312d20bf246631737805c5
Stop computing a "sharedram" value when emulating Linux sysinfo(2).

The previous code was computing an incorrect value in a very expensive
manner.  "sharedram" is supposed to be the amount of memory used by
named swap objects, which on FreeBSD basically corresponds to memory
usage by shared memory objects (including, for example, GEM objects) and
tmpfs.  We currently have no cheap way to count such pages.  The
previous code tried to determine the number of copy-on-write pages
shared between processes.

Just replace the computed value with 0.  illumos reportedly does the
same thing.  Linux itself did not populate this field until a 2014
commit, "mm: export NR_SHMEM via sysinfo(2) / si_meminfo() interfaces".

Reported by: mjg
MFC after: 1 week
sys/compat/linux/linux_misc.c