Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Jul 2012 19:10:44 +0000 (UTC)
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r238751 - in stable/8/sys: kern sys
Message-ID:  <201207241910.q6OJAinu063851@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trociny
Date: Tue Jul 24 19:10:43 2012
New Revision: 238751
URL: http://svn.freebsd.org/changeset/base/238751

Log:
  MFC r227316:
  
  Add KVME_FLAG_SUPER and use it in sysctl_kern_proc_vmmap for marking
  entries with superpages.
  
  Submitted by:	Mel Flynn <mel.flynn+fbsd.hackers@mailing.thruhere.net>
  Reviewed by:	alc, rwatson

Modified:
  stable/8/sys/kern/kern_proc.c
  stable/8/sys/sys/user.h
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/kern/kern_proc.c
==============================================================================
--- stable/8/sys/kern/kern_proc.c	Tue Jul 24 19:08:12 2012	(r238750)
+++ stable/8/sys/kern/kern_proc.c	Tue Jul 24 19:10:43 2012	(r238751)
@@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/limits.h>
 #include <sys/lock.h>
 #include <sys/malloc.h>
+#include <sys/mman.h>
 #include <sys/mount.h>
 #include <sys/mutex.h>
 #include <sys/proc.h>
@@ -74,6 +75,7 @@ __FBSDID("$FreeBSD$");
 #include <vm/pmap.h>
 #include <vm/vm_map.h>
 #include <vm/vm_object.h>
+#include <vm/vm_page.h>
 #include <vm/uma.h>
 
 #ifdef COMPAT_FREEBSD32
@@ -1750,7 +1752,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 	    entry = entry->next) {
 		vm_object_t obj, tobj, lobj;
 		vm_offset_t addr;
-		int vfslocked;
+		int vfslocked, mincoreinfo;
 
 		if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)
 			continue;
@@ -1768,8 +1770,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 		kve->kve_resident = 0;
 		addr = entry->start;
 		while (addr < entry->end) {
-			if (pmap_extract(map->pmap, addr))
+			mincoreinfo = pmap_mincore(map->pmap, addr);
+			if (mincoreinfo & MINCORE_INCORE)
 				kve->kve_resident++;
+			if (mincoreinfo & MINCORE_SUPER)
+				kve->kve_flags |= KVME_FLAG_SUPER;
 			addr += PAGE_SIZE;
 		}
 

Modified: stable/8/sys/sys/user.h
==============================================================================
--- stable/8/sys/sys/user.h	Tue Jul 24 19:08:12 2012	(r238750)
+++ stable/8/sys/sys/user.h	Tue Jul 24 19:10:43 2012	(r238751)
@@ -338,6 +338,7 @@ struct kinfo_file {
 #define	KVME_FLAG_COW		0x00000001
 #define	KVME_FLAG_NEEDS_COPY	0x00000002
 #define	KVME_FLAG_NOCOREDUMP	0x00000004
+#define	KVME_FLAG_SUPER		0x00000008
 
 #if defined(__amd64__)
 #define	KINFO_OVMENTRY_SIZE	1168



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