summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/lwp.c
diff options
context:
space:
mode:
authorakolb <none@none>2007-03-09 15:55:28 -0800
committerakolb <none@none>2007-03-09 15:55:28 -0800
commitc97ad5cdc75eb73e3cc38542ca3ba783574b0a7a (patch)
tree5ba1653d892978d87d6061c8c7f3821f4b3e354c /usr/src/uts/common/os/lwp.c
parent68d3ac02fc9db49ae9dccaecff999963114930a7 (diff)
downloadillumos-joyent-c97ad5cdc75eb73e3cc38542ca3ba783574b0a7a.tar.gz
PSARC/2004/402 CPU Caps
6327235 PSARC/2004/402 CPU caps 6464161 Dead KSLICE code should be removed 6514387 FX class contains dead code to keep list of member threads 6518395 kstat_zone_add performs KM_SLEEP allocation when it should not
Diffstat (limited to 'usr/src/uts/common/os/lwp.c')
-rw-r--r--usr/src/uts/common/os/lwp.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr/src/uts/common/os/lwp.c b/usr/src/uts/common/os/lwp.c
index 7533fb0028..c1d1a870e0 100644
--- a/usr/src/uts/common/os/lwp.c
+++ b/usr/src/uts/common/os/lwp.c
@@ -781,6 +781,7 @@ lwp_exit(void)
t->t_proc_flag |= TP_LWPEXIT;
term_mstate(t);
+
#ifndef NPROBE
/* Kernel probe */
if (t->t_tnf_tpdp)
@@ -916,10 +917,12 @@ top:
* XXX Should use virtual stop like /proc does instead of
* XXX waking the thread to get it to stop.
*/
- if (t->t_state == TS_SLEEP && (t->t_flag & T_WAKEABLE))
+ if (ISWAKEABLE(t) || ISWAITING(t)) {
setrun_locked(t);
- else if (t->t_state == TS_ONPROC && t->t_cpu != CPU)
+ } else if (t->t_state == TS_ONPROC && t->t_cpu != CPU) {
poke_cpu(t->t_cpu->cpu_id);
+ }
+
tid = t->t_tid; /* remember thread ID */
/*
* Wait for lwp to stop
@@ -1360,9 +1363,8 @@ pokelwps(proc_t *p)
continue;
thread_lock(t);
aston(t); /* make thread trap or do post_syscall */
- if (t->t_state == TS_SLEEP) {
- if (t->t_flag & T_WAKEABLE)
- setrun_locked(t);
+ if (ISWAKEABLE(t) || ISWAITING(t)) {
+ setrun_locked(t);
} else if (t->t_state == TS_STOPPED) {
/*
* Ensure that proc_exit() is not blocked by lwps