From owner-svn-src-head@FreeBSD.ORG Mon Nov 7 21:13:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD271065674; Mon, 7 Nov 2011 21:13:19 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965728FC17; Mon, 7 Nov 2011 21:13:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA7LDJlT096651; Mon, 7 Nov 2011 21:13:19 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA7LDJLf096648; Mon, 7 Nov 2011 21:13:19 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201111072113.pA7LDJLf096648@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 7 Nov 2011 21:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227316 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 07 Nov 2011 21:13:19 -0000 Author: trociny Date: Mon Nov 7 21:13:19 2011 New Revision: 227316 URL: http://svn.freebsd.org/changeset/base/227316 Log: Add KVME_FLAG_SUPER and use it in sysctl_kern_proc_vmmap for marking entries with superpages. Submitted by: Mel Flynn Reviewed by: alc, rwatson Modified: head/sys/kern/kern_proc.c head/sys/sys/user.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Nov 7 21:09:04 2011 (r227315) +++ head/sys/kern/kern_proc.c Mon Nov 7 21:13:19 2011 (r227316) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef COMPAT_FREEBSD32 @@ -1710,7 +1712,8 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR entry = entry->next) { vm_object_t obj, tobj, lobj; vm_offset_t addr; - int vfslocked; + vm_paddr_t locked_pa; + int vfslocked, mincoreinfo; if (entry->eflags & MAP_ENTRY_IS_SUB_MAP) continue; @@ -1728,8 +1731,14 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR kve->kve_resident = 0; addr = entry->start; while (addr < entry->end) { - if (pmap_extract(map->pmap, addr)) + locked_pa = 0; + mincoreinfo = pmap_mincore(map->pmap, addr, &locked_pa); + if (locked_pa != 0) + vm_page_unlock(PHYS_TO_VM_PAGE(locked_pa)); + if (mincoreinfo & MINCORE_INCORE) kve->kve_resident++; + if (mincoreinfo & MINCORE_SUPER) + kve->kve_flags |= KVME_FLAG_SUPER; addr += PAGE_SIZE; } Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Mon Nov 7 21:09:04 2011 (r227315) +++ head/sys/sys/user.h Mon Nov 7 21:13:19 2011 (r227316) @@ -412,6 +412,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