Deleted Added
full compact
66c66
< __FBSDID("$FreeBSD: head/sys/vm/vm_map.c 219819 2011-03-21 09:40:01Z jeff $");
---
> __FBSDID("$FreeBSD: head/sys/vm/vm_map.c 220373 2011-04-05 20:23:59Z trasz $");
77a78
> #include <sys/racct.h>
315a317,329
> static void
> vmspace_container_reset(struct proc *p)
> {
>
> PROC_LOCK(p);
> racct_set(p, RACCT_DATA, 0);
> racct_set(p, RACCT_STACK, 0);
> racct_set(p, RACCT_RSS, 0);
> racct_set(p, RACCT_MEMLOCK, 0);
> racct_set(p, RACCT_VMEM, 0);
> PROC_UNLOCK(p);
> }
>
412a427
> vmspace_container_reset(p);
3281a3297,3300
> #ifdef notyet
> uint64_t limit;
> #endif
> int error;
3379a3399,3406
> PROC_LOCK(p);
> if (is_procstack &&
> racct_set(p, RACCT_STACK, ctob(vm->vm_ssize) + grow_amount)) {
> PROC_UNLOCK(p);
> vm_map_unlock_read(map);
> return (KERN_NO_SPACE);
> }
> PROC_UNLOCK(p);
3388a3416,3422
> #ifdef notyet
> PROC_LOCK(p);
> limit = racct_get_available(p, RACCT_STACK);
> PROC_UNLOCK(p);
> if (is_procstack && (ctob(vm->vm_ssize) + grow_amount > limit))
> grow_amount = limit - ctob(vm->vm_ssize);
> #endif
3393c3427,3428
< return (KERN_NO_SPACE);
---
> rv = KERN_NO_SPACE;
> goto out;
3394a3430,3437
> PROC_LOCK(p);
> if (racct_set(p, RACCT_VMEM, map->size + grow_amount)) {
> PROC_UNLOCK(p);
> vm_map_unlock_read(map);
> rv = KERN_NO_SPACE;
> goto out;
> }
> PROC_UNLOCK(p);
3492a3536,3545
> out:
> if (rv != KERN_SUCCESS) {
> PROC_LOCK(p);
> error = racct_set(p, RACCT_VMEM, map->size);
> KASSERT(error == 0, ("decreasing RACCT_VMEM failed"));
> error = racct_set(p, RACCT_STACK, ctob(vm->vm_ssize));
> KASSERT(error == 0, ("decreasing RACCT_STACK failed"));
> PROC_UNLOCK(p);
> }
>