Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jul 2014 15:07:07 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r269090 - stable/9/sys/kern
Message-ID:  <201407251507.s6PF77Lv091531@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Jul 25 15:07:07 2014
New Revision: 269090
URL: http://svnweb.freebsd.org/changeset/base/269090

Log:
  Partial MFC of r268466:
  Add a knob to disable the residency calculation for kern.proc.vmmap.
  
  Tested by:	"Ivan A. Kosarev" <ikosarev@accesssoftek.com>

Modified:
  stable/9/sys/kern/kern_proc.c

Modified: stable/9/sys/kern/kern_proc.c
==============================================================================
--- stable/9/sys/kern/kern_proc.c	Fri Jul 25 14:47:44 2014	(r269089)
+++ stable/9/sys/kern/kern_proc.c	Fri Jul 25 15:07:07 2014	(r269090)
@@ -141,6 +141,10 @@ uma_zone_t proc_zone;
 int kstack_pages = KSTACK_PAGES;
 SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0,
     "Kernel stack size in pages");
+static int vmmap_skip_res_cnt = 0;
+SYSCTL_INT(_kern, OID_AUTO, proc_vmmap_skip_resident_count, CTLFLAG_RW,
+    &vmmap_skip_res_cnt, 0,
+    "Skip calculation of the pages resident count in kern.proc.vmmap");
 
 CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE);
 #ifdef COMPAT_FREEBSD32
@@ -2189,6 +2193,8 @@ kern_proc_vmmap_out(struct proc *p, stru
 		}
 		kve->kve_resident = 0;
 		addr = entry->start;
+		if (vmmap_skip_res_cnt)
+			goto skip_resident_count;
 		while (addr < entry->end) {
 			locked_pa = 0;
 			mincoreinfo = pmap_mincore(map->pmap, addr, &locked_pa);
@@ -2201,6 +2207,7 @@ kern_proc_vmmap_out(struct proc *p, stru
 			addr += PAGE_SIZE;
 		}
 
+skip_resident_count:
 		for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) {
 			if (tobj != obj)
 				VM_OBJECT_LOCK(tobj);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407251507.s6PF77Lv091531>