diff options
author | akolb <none@none> | 2007-03-09 15:55:28 -0800 |
---|---|---|
committer | akolb <none@none> | 2007-03-09 15:55:28 -0800 |
commit | c97ad5cdc75eb73e3cc38542ca3ba783574b0a7a (patch) | |
tree | 5ba1653d892978d87d6061c8c7f3821f4b3e354c /usr/src/uts/common/os/task.c | |
parent | 68d3ac02fc9db49ae9dccaecff999963114930a7 (diff) | |
download | illumos-gate-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/task.c')
-rw-r--r-- | usr/src/uts/common/os/task.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/usr/src/uts/common/os/task.c b/usr/src/uts/common/os/task.c index 785f74c145..5e4ae1aefe 100644 --- a/usr/src/uts/common/os/task.c +++ b/usr/src/uts/common/os/task.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -388,8 +388,7 @@ task_create(projid_t projid, zone_t *zone) tk->tk_nlwps = 0; tk->tk_nlwps_ctl = INT_MAX; tk->tk_usage = tu; - tk->tk_proj = project_hold_by_id(projid, zone, - PROJECT_HOLD_INSERT); + tk->tk_proj = project_hold_by_id(projid, zone, PROJECT_HOLD_INSERT); tk->tk_flags = TASK_NORMAL; /* @@ -670,6 +669,21 @@ changeproj(proc_t *p, kproject_t *kpj, zone_t *zone, void *projbuf, thread_lock(t); oldkpj = ttoproj(t); + + /* + * Kick this thread so that he doesn't sit + * on a wrong wait queue. + */ + if (ISWAITING(t)) + setrun_locked(t); + + /* + * The thread wants to go on the project wait queue, but + * the waitq is changing. + */ + if (t->t_schedflag & TS_PROJWAITQ) + t->t_schedflag &= ~ TS_PROJWAITQ; + t->t_proj = kpj; t->t_pre_sys = 1; /* For cred update */ thread_unlock(t); |