diff options
author | attilio <attilio@FreeBSD.org> | 2007-06-04 21:45:18 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2007-06-04 21:45:18 +0000 |
commit | 9bd4fdf7ce811d83f0305cacc5990ec339df9f13 (patch) | |
tree | 9c942b3b9815da8b9fd9ecd5f775fdc264e8e2dc /sys/kern | |
parent | e333d0ff0eb23a5f94f36fd95b4bbcfda3ccbc8f (diff) | |
download | FreeBSD-src-9bd4fdf7ce811d83f0305cacc5990ec339df9f13.zip FreeBSD-src-9bd4fdf7ce811d83f0305cacc5990ec339df9f13.tar.gz |
Do proper "locking" for missing vmmeters part.
Now, we assume no more sched_lock protection for some of them and use the
distribuited loads method for vmmeter (distribuited through CPUs).
Reviewed by: alc, bde
Approved by: jeff (mentor)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_synch.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_thread.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_trap.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index b75dcf2..c45e846 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -412,7 +412,7 @@ mi_switch(int flags, struct thread *newtd) td->td_runtime += new_switchtime - PCPU_GET(switchtime); PCPU_SET(switchtime, new_switchtime); td->td_generation++; /* bump preempt-detect counter */ - cnt.v_swtch++; + PCPU_INC(cnt.v_swtch); PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (kse %p, pid %ld, %s)", td->td_tid, td->td_sched, p->p_pid, p->p_comm); diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index dcb00b7..12a077c 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -405,7 +405,7 @@ thread_exit(void) p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime)); PCPU_SET(switchtime, new_switchtime); PCPU_SET(switchticks, ticks); - cnt.v_swtch++; + PCPU_INC(cnt.v_swtch); /* * Aggregate this thread's tick stats in the parent so they are not * lost. Also add the child usage to our own when the final thread diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index e9d9c35..f839ace 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -190,8 +190,8 @@ ast(struct trapframe *framep) #endif td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK | TDF_NEEDRESCHED | TDF_INTERRUPT); - cnt.v_trap++; mtx_unlock_spin(&sched_lock); + PCPU_INC(cnt.v_trap); /* * XXXKSE While the fact that we owe a user profiling |