diff options
author | jeff <jeff@FreeBSD.org> | 2008-04-17 04:20:10 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2008-04-17 04:20:10 +0000 |
commit | 9d30d1d7a4245f9915c17e74f97d6909fb40ada9 (patch) | |
tree | 670d4df2ed30d93745545294f2c7cb18db2f3d2c /sys/kern/subr_sleepqueue.c | |
parent | a61cdf99c2c0d01312b2493fb6f7b245ba4f0ba9 (diff) | |
download | FreeBSD-src-9d30d1d7a4245f9915c17e74f97d6909fb40ada9.zip FreeBSD-src-9d30d1d7a4245f9915c17e74f97d6909fb40ada9.tar.gz |
- Make SCHED_STATS more generic by adding a wrapper to create the
variables and sysctl nodes.
- In reset walk the children of kern_sched_stats and reset the counters
via the oid_arg1 pointer. This allows us to add arbitrary counters to
the tree and still reset them properly.
- Define a set of switch types to be passed with flags to mi_switch().
These types are named SWT_*. These types correspond to SCHED_STATS
counters and are automatically handled in this way.
- Make the new SWT_ types more specific than the older switch stats.
There are now stats for idle switches, remote idle wakeups, remote
preemption ithreads idling, etc.
- Add switch statistics for ULE's pickcpu algorithm. These stats include
how much migration there is, how often affinity was successful, how
often threads were migrated to the local cpu on wakeup, etc.
Sponsored by: Nokia
Diffstat (limited to 'sys/kern/subr_sleepqueue.c')
-rw-r--r-- | sys/kern/subr_sleepqueue.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 9edd56e..1dbd1db 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -486,8 +486,7 @@ sleepq_switch(void *wchan, int pri) sched_sleep(td, pri); thread_lock_set(td, &sc->sc_lock); TD_SET_SLEEPING(td); - SCHED_STAT_INC(switch_sleepq); - mi_switch(SW_VOL, NULL); + mi_switch(SW_VOL | SWT_SLEEPQ, NULL); KASSERT(TD_IS_RUNNING(td), ("running but not TDS_RUNNING")); CTR3(KTR_PROC, "sleepq resume: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, (void *)td->td_name); @@ -527,8 +526,7 @@ sleepq_check_timeout(void) else if (callout_stop(&td->td_slpcallout) == 0) { td->td_flags |= TDF_TIMEOUT; TD_SET_SLEEPING(td); - SCHED_STAT_INC(switch_sleepqtimo); - mi_switch(SW_INVOL, NULL); + mi_switch(SW_INVOL | SWT_SLEEPQTIMO, NULL); } return (0); } |