From owner-svn-src-head@freebsd.org Fri Aug 18 16:43:00 2017 Return-Path: Delivered-To: svn-src-head@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 531F3DC678F; Fri, 18 Aug 2017 16:43:00 +0000 (UTC) (envelope-from sevan@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 226FB6C33D; Fri, 18 Aug 2017 16:43:00 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7IGgwWd023583; Fri, 18 Aug 2017 16:42:58 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7IGgw2g023582; Fri, 18 Aug 2017 16:42:58 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201708181642.v7IGgw2g023582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Fri, 18 Aug 2017 16:42:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322665 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 322665 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Aug 2017 16:43:00 -0000 Author: sevan (doc committer) Date: Fri Aug 18 16:42:58 2017 New Revision: 322665 URL: https://svnweb.freebsd.org/changeset/base/322665 Log: Add caveat to kinfo_getvmmap(3) explaining high CPU utilisation. Based on kib's reply on https://lists.freebsd.org/pipermail/freebsd-hackers/2016-July/049710.html PR: 210904 Submitted by: Yuri Victorovich Reviewed by: jilles Approved by: bcr (mentor) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D12004 Modified: head/lib/libutil/kinfo_getvmmap.3 Modified: head/lib/libutil/kinfo_getvmmap.3 ============================================================================== --- head/lib/libutil/kinfo_getvmmap.3 Fri Aug 18 16:38:33 2017 (r322664) +++ head/lib/libutil/kinfo_getvmmap.3 Fri Aug 18 16:42:58 2017 (r322665) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2015 +.Dd August 18, 2017 .Dt KINFO_GETVMMAP 3 .Os .Sh NAME @@ -58,6 +58,13 @@ with the mib. While the kernel returns a packed structure, this function expands the data into a fixed record format. +.Sh CAVEAT +.Fn kinfo_getvmmap +calls can cause significant CPU consumption because calculating the residency +counts requires iterating over all memory pages of the process. +Setting the sysctl variable +.Va kern.proc_vmmap_skip_resident_count +to 1 prevents this calculation. .Sh RETURN VALUES On success the .Fn kinfo_getvmmap