summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorjohansen <none@none>2007-04-19 16:50:51 -0700
committerjohansen <none@none>2007-04-19 16:50:51 -0700
commit14e7cc63ee66eb6a6349f73882884e71d5771237 (patch)
tree973e6fe6561563c9590bdd6b8a491cb7d2976349 /usr/src
parent0bf246f5efaa80a4f69d1dd27714e59408bbe41c (diff)
downloadillumos-gate-14e7cc63ee66eb6a6349f73882884e71d5771237.tar.gz
6492317 sometimes time stamps from gethrvtime are back in time
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/os/msacct.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr/src/uts/common/os/msacct.c b/usr/src/uts/common/os/msacct.c
index 57c56cef8f..fb4de281e8 100644
--- a/usr/src/uts/common/os/msacct.c
+++ b/usr/src/uts/common/os/msacct.c
@@ -543,7 +543,14 @@ new_mstate(kthread_t *t, int new_state)
ASSERT((unsigned)new_state < NMSTATES);
ASSERT(t == curthread || THREAD_LOCK_HELD(t));
- if ((lwp = ttolwp(t)) == NULL)
+ /*
+ * Don't do microstate processing for threads without a lwp (kernel
+ * threads). Also, if we're an interrupt thread that is pinning another
+ * thread, our t_mstate hasn't been initialized. We'd be modifying the
+ * microstate of the underlying lwp which doesn't realize that it's
+ * pinned. In this case, also don't change the microstate.
+ */
+ if (((lwp = ttolwp(t)) == NULL) || t->t_intr)
return (LMS_SYSTEM);
curtime = gethrtime_unscaled();
@@ -615,6 +622,14 @@ restore_mstate(kthread_t *t)
hrtime_t newtime;
hrtime_t oldtime;
+ /*
+ * Don't call restore mstate of threads without lwps. (Kernel threads)
+ *
+ * threads with t_intr set shouldn't be in the dispatcher, so assert
+ * that nobody here has t_intr.
+ */
+ ASSERT(t->t_intr == NULL);
+
if ((lwp = ttolwp(t)) == NULL)
return;