Index: sys/vm/vm_mmap.c =================================================================== --- sys/vm/vm_mmap.c (revision 220888) +++ sys/vm/vm_mmap.c (working copy) @@ -48,7 +48,6 @@ #include #include -#include #include #include #include @@ -66,7 +65,6 @@ #include #include #include -#include #include @@ -80,7 +78,6 @@ #include #include #include -#include #ifdef HWPMC_HOOKS #include @@ -92,30 +89,6 @@ }; #endif -static int max_proc_mmap; -SYSCTL_INT(_vm, OID_AUTO, max_proc_mmap, CTLFLAG_RW, &max_proc_mmap, 0, - "Maximum number of memory-mapped files per process"); - -/* - * Set the maximum number of vm_map_entry structures per process. Roughly - * speaking vm_map_entry structures are tiny, so allowing them to eat 1/100 - * of our KVM malloc space still results in generous limits. We want a - * default that is good enough to prevent the kernel running out of resources - * if attacked from compromised user account but generous enough such that - * multi-threaded processes are not unduly inconvenienced. - */ -static void vmmapentry_rsrc_init(void *); -SYSINIT(vmmersrc, SI_SUB_KVM_RSRC, SI_ORDER_FIRST, vmmapentry_rsrc_init, - NULL); - -static void -vmmapentry_rsrc_init(dummy) - void *dummy; -{ - max_proc_mmap = vm_kmem_size / sizeof(struct vm_map_entry); - max_proc_mmap /= 100; -} - static int vm_mmap_vnode(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, int *, struct vnode *, vm_ooffset_t *, vm_object_t *); static int vm_mmap_cdev(struct thread *, vm_size_t, vm_prot_t, vm_prot_t *, @@ -375,18 +348,6 @@ handle_type = OBJT_VNODE; } map: - - /* - * Do not allow more then a certain number of vm_map_entry structures - * per process. Scale with the number of rforks sharing the map - * to make the limit reasonable for threads. - */ - if (max_proc_mmap && - vms->vm_map.nentries >= max_proc_mmap * vms->vm_refcnt) { - error = ENOMEM; - goto done; - } - td->td_fpop = fp; error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot, flags, handle_type, handle, pos);