From c97ad5cdc75eb73e3cc38542ca3ba783574b0a7a Mon Sep 17 00:00:00 2001 From: akolb Date: Fri, 9 Mar 2007 15:55:28 -0800 Subject: 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 --- usr/src/uts/common/os/task.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'usr/src/uts/common/os/task.c') 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); -- cgit v1.2.3