summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2016-12-31 13:04:12 +0000
committermjg <mjg@FreeBSD.org>2016-12-31 13:04:12 +0000
commit57c2919e0d0e8bc07f304a2d1ef2fc9071204598 (patch)
tree95efdf42039249fb7ecfc8d7f0b42a44367bffa4
parent4a1aec69b8c54ceaac717e92e810f38dfbf845f2 (diff)
downloadFreeBSD-src-57c2919e0d0e8bc07f304a2d1ef2fc9071204598.zip
FreeBSD-src-57c2919e0d0e8bc07f304a2d1ef2fc9071204598.tar.gz
MFC r305856:
linprocfs: garbage collect meminfo fields not present in linux In particular memshared not only does not exist in linux, it was extremely expensive to calculate.
-rw-r--r--sys/compat/linprocfs/linprocfs.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index f1bae96..85a5d96 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -144,12 +144,10 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
unsigned long memtotal; /* total memory in bytes */
unsigned long memused; /* used memory in bytes */
unsigned long memfree; /* free memory in bytes */
- unsigned long memshared; /* shared memory ??? */
unsigned long buffers, cached; /* buffer / cache memory ??? */
unsigned long long swaptotal; /* total swap space in bytes */
unsigned long long swapused; /* used swap space in bytes */
unsigned long long swapfree; /* free swap space in bytes */
- vm_object_t object;
int i, j;
memtotal = physmem * PAGE_SIZE;
@@ -169,13 +167,6 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
swaptotal = (unsigned long long)i * PAGE_SIZE;
swapused = (unsigned long long)j * PAGE_SIZE;
swapfree = swaptotal - swapused;
- memshared = 0;
- mtx_lock(&vm_object_list_mtx);
- TAILQ_FOREACH(object, &vm_object_list, object_list)
- if (object->shadow_count > 1)
- memshared += object->resident_page_count;
- mtx_unlock(&vm_object_list_mtx);
- memshared *= PAGE_SIZE;
/*
* We'd love to be able to write:
*
@@ -188,21 +179,14 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
cached = vm_cnt.v_cache_count * PAGE_SIZE;
sbuf_printf(sb,
- " total: used: free: shared: buffers: cached:\n"
- "Mem: %lu %lu %lu %lu %lu %lu\n"
- "Swap: %llu %llu %llu\n"
"MemTotal: %9lu kB\n"
"MemFree: %9lu kB\n"
- "MemShared:%9lu kB\n"
"Buffers: %9lu kB\n"
"Cached: %9lu kB\n"
"SwapTotal:%9llu kB\n"
"SwapFree: %9llu kB\n",
- memtotal, memused, memfree, memshared, buffers, cached,
- swaptotal, swapused, swapfree,
- B2K(memtotal), B2K(memfree),
- B2K(memshared), B2K(buffers), B2K(cached),
- B2K(swaptotal), B2K(swapfree));
+ B2K(memtotal), B2K(memfree), B2K(buffers),
+ B2K(cached), B2K(swaptotal), B2K(swapfree));
return (0);
}
OpenPOWER on IntegriCloud