summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authorzont <zont@FreeBSD.org>2012-08-29 11:23:59 +0000
committerzont <zont@FreeBSD.org>2012-08-29 11:23:59 +0000
commit85dfc3b8b7b1a2202d6ab579cc73c5cf0261c0e9 (patch)
tree63e62d8df0a93569f3b96e604763073da5498ee5 /sys/vm/vm_glue.c
parenta5fd8dfa441c3d5415b2e3876d4ddf3933c0f3e9 (diff)
downloadFreeBSD-src-85dfc3b8b7b1a2202d6ab579cc73c5cf0261c0e9.zip
FreeBSD-src-85dfc3b8b7b1a2202d6ab579cc73c5cf0261c0e9.tar.gz
- 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
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index e4a4bd8..a7eba80 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -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.
OpenPOWER on IntegriCloud