Author: mjg
Date: Sat Dec 31 13:04:12 2016
New Revision: 310969
URL: https://svnweb.freebsd.org/changeset/base/310969

Log:
  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.

Modified:
  stable/11/sys/compat/linprocfs/linprocfs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linprocfs/linprocfs.c
==============================================================================
--- stable/11/sys/compat/linprocfs/linprocfs.c  Sat Dec 31 12:58:26 2016        
(r310968)
+++ stable/11/sys/compat/linprocfs/linprocfs.c  Sat Dec 31 13:04:12 2016        
(r310969)
@@ -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);
 }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to