summaryrefslogtreecommitdiffstats
path: root/sys/sys/sched.h
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2008-04-17 04:20:10 +0000
committerjeff <jeff@FreeBSD.org>2008-04-17 04:20:10 +0000
commit9d30d1d7a4245f9915c17e74f97d6909fb40ada9 (patch)
tree670d4df2ed30d93745545294f2c7cb18db2f3d2c /sys/sys/sched.h
parenta61cdf99c2c0d01312b2493fb6f7b245ba4f0ba9 (diff)
downloadFreeBSD-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/sys/sched.h')
-rw-r--r--sys/sys/sched.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/sys/sched.h b/sys/sys/sched.h
index fa57055..bbd2199 100644
--- a/sys/sys/sched.h
+++ b/sys/sys/sched.h
@@ -154,17 +154,19 @@ sched_unpin(void)
#define SRQ_PREEMPTED 0x0008 /* has been preempted.. be kind */
#define SRQ_BORROWING 0x0010 /* Priority updated due to prio_lend */
-/* Switch stats. */
+/* Scheduler stats. */
#ifdef SCHED_STATS
-extern long switch_preempt;
-extern long switch_owepreempt;
-extern long switch_turnstile;
-extern long switch_sleepq;
-extern long switch_sleepqtimo;
-extern long switch_relinquish;
-extern long switch_needresched;
+extern long sched_switch_stats[SWT_COUNT];
+
+#define SCHED_STAT_DEFINE_VAR(name, ptr, descr) \
+ SYSCTL_LONG(_kern_sched_stats, OID_AUTO, name, CTLFLAG_RD, ptr, 0, descr)
+#define SCHED_STAT_DEFINE(name, descr) \
+ unsigned long name; \
+ SCHED_STAT_DEFINE_VAR(name, &name, descr)
#define SCHED_STAT_INC(var) atomic_add_long(&(var), 1)
#else
+#define SCHED_STAT_DEFINE_VAR(name, descr, ptr)
+#define SCHED_STAT_DEFINE(name, descr)
#define SCHED_STAT_INC(var)
#endif
OpenPOWER on IntegriCloud