diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2007-06-10 21:59:14 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2007-06-10 21:59:14 +0000 |
commit | 393a081d42bfbe91414ef0c85c8f56c4f452a3b7 (patch) | |
tree | 5076d8c3c653c4deb666bc72dcf20bf604e5fb6e /sys/kern/kern_fork.c | |
parent | f194524fb14f7a9b70207ae27955161cff73436c (diff) | |
download | src-393a081d42bfbe91414ef0c85c8f56c4f452a3b7.tar.gz src-393a081d42bfbe91414ef0c85c8f56c4f452a3b7.zip |
Optimize vmmeter locking.
In particular:
- Add an explicative table for locking of struct vmmeter members
- Apply new rules for some of those members
- Remove some unuseful comments
Heavily reviewed by: alc, bde, jeff
Approved by: jeff (mentor)
Notes
Notes:
svn path=/head/; revision=170517
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r-- | sys/kern/kern_fork.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 04b31d4d1d94..ae69afe5e8f4 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -658,20 +658,20 @@ again: vm_forkproc(td, p2, td2, flags); if (flags == (RFFDG | RFPROC)) { - atomic_add_int(&cnt.v_forks, 1); - atomic_add_int(&cnt.v_forkpages, p2->p_vmspace->vm_dsize + + PCPU_INC(cnt.v_forks); + PCPU_ADD(cnt.v_forkpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } else if (flags == (RFFDG | RFPROC | RFPPWAIT | RFMEM)) { - atomic_add_int(&cnt.v_vforks, 1); - atomic_add_int(&cnt.v_vforkpages, p2->p_vmspace->vm_dsize + + PCPU_INC(cnt.v_vforks); + PCPU_ADD(cnt.v_vforkpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } else if (p1 == &proc0) { - atomic_add_int(&cnt.v_kthreads, 1); - atomic_add_int(&cnt.v_kthreadpages, p2->p_vmspace->vm_dsize + + PCPU_INC(cnt.v_kthreads); + PCPU_ADD(cnt.v_kthreadpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } else { - atomic_add_int(&cnt.v_rforks, 1); - atomic_add_int(&cnt.v_rforkpages, p2->p_vmspace->vm_dsize + + PCPU_INC(cnt.v_rforks); + PCPU_ADD(cnt.v_rforkpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } |