From owner-svn-src-all@FreeBSD.ORG Wed Aug 29 11:23:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A38121065680; Wed, 29 Aug 2012 11:23:59 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2F98FC1D; Wed, 29 Aug 2012 11:23:59 +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 q7TBNxVI035459; Wed, 29 Aug 2012 11:23:59 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TBNxJb035457; Wed, 29 Aug 2012 11:23:59 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201208291123.q7TBNxJb035457@svn.freebsd.org> From: Andrey Zonov Date: Wed, 29 Aug 2012 11:23:59 +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: r239818 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 29 Aug 2012 11:23:59 -0000 Author: zont Date: Wed Aug 29 11:23:59 2012 New Revision: 239818 URL: http://svn.freebsd.org/changeset/base/239818 Log: - Don't take an account of locked memory for current process in vslock(9). There are two consumers of vslock(9): sysctl code and drm driver. These consumers are using locked memory as transient memory, it doesn't belong to a process's memory. Suggested by: avg Reviewed by: alc Approved by: kib (mentor) MFC after: 2 weeks Modified: head/sys/vm/vm_glue.c Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Aug 29 11:23:20 2012 (r239817) +++ head/sys/vm/vm_glue.c Wed Aug 29 11:23:59 2012 (r239818) @@ -183,7 +183,6 @@ int vslock(void *addr, size_t len) { vm_offset_t end, last, start; - unsigned long nsize; vm_size_t npages; int error; @@ -195,18 +194,6 @@ vslock(void *addr, size_t len) npages = atop(end - start); if (npages > vm_page_max_wired) return (ENOMEM); - PROC_LOCK(curproc); - nsize = ptoa(npages + - pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map))); - if (nsize > lim_cur(curproc, RLIMIT_MEMLOCK)) { - PROC_UNLOCK(curproc); - return (ENOMEM); - } - if (racct_set(curproc, RACCT_MEMLOCK, nsize)) { - PROC_UNLOCK(curproc); - return (ENOMEM); - } - PROC_UNLOCK(curproc); #if 0 /* * XXX - not yet @@ -222,14 +209,6 @@ vslock(void *addr, size_t len) #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, VM_MAP_WIRE_SYSTEM | VM_MAP_WIRE_NOHOLES); -#ifdef RACCT - if (error != KERN_SUCCESS) { - PROC_LOCK(curproc); - racct_set(curproc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm_map_pmap(&curproc->p_vmspace->vm_map)))); - PROC_UNLOCK(curproc); - } -#endif /* * Return EFAULT on error to match copy{in,out}() behaviour * rather than returning ENOMEM like mlock() would.