From owner-svn-src-all@freebsd.org Fri Sep 16 03:36:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF90EBDB43B; Fri, 16 Sep 2016 03:36:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 662191FA3; Fri, 16 Sep 2016 03:36:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8G3ahPg012244; Fri, 16 Sep 2016 03:36:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8G3ahxC012243; Fri, 16 Sep 2016 03:36:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201609160336.u8G3ahxC012243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 16 Sep 2016 03:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r305856 - head/sys/compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 03:36:44 -0000 Author: mjg Date: Fri Sep 16 03:36:43 2016 New Revision: 305856 URL: https://svnweb.freebsd.org/changeset/base/305856 Log: 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: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Sep 16 03:04:48 2016 (r305855) +++ head/sys/compat/linprocfs/linprocfs.c Fri Sep 16 03:36:43 2016 (r305856) @@ -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); }