--- //depot/vendor/freebsd/src/sys/dev/hwpmc/hwpmc_mod.c 2006/03/26 12:27:28 +++ //depot/projects/smpng/sys/dev/hwpmc/hwpmc_mod.c 2006/04/12 19:21:13 @@ -646,15 +646,8 @@ static void pmc_force_context_switch(void) { - u_char curpri; - mtx_lock_spin(&sched_lock); - curpri = curthread->td_priority; - mtx_unlock_spin(&sched_lock); - - (void) tsleep((void *) pmc_force_context_switch, curpri, - "pmcctx", 1); - + (void) tsleep((void *) pmc_force_context_switch, 0, "pmcctx", 1); } /* --- //depot/vendor/freebsd/src/sys/dev/random/randomdev_soft.c 2005/12/20 21:45:56 +++ //depot/projects/smpng/sys/dev/random/randomdev_soft.c 2006/04/12 19:21:13 @@ -211,8 +211,7 @@ * Command the hash/reseed thread to end and wait for it to finish */ random_kthread_control = -1; - tsleep((void *)&random_kthread_control, curthread->td_priority, "term", - 0); + tsleep((void *)&random_kthread_control, 0, "term", 0); /* Destroy the harvest fifos */ while (!STAILQ_EMPTY(&emptyfifo.head)) { @@ -285,8 +284,7 @@ /* Found nothing, so don't belabour the issue */ if (!active) - tsleep(&harvestfifo, curthread->td_priority, "-", - hz / 10); + tsleep(&harvestfifo, 0, "-", hz / 10); } --- //depot/vendor/freebsd/src/sys/kern/kern_intr.c 2005/10/26 15:55:44 +++ //depot/projects/smpng/sys/kern/kern_intr.c 2006/04/12 19:21:13 @@ -371,8 +371,7 @@ /* Create a thread if we need one. */ while (ie->ie_thread == NULL && !(flags & INTR_FAST)) { if (ie->ie_flags & IE_ADDING_THREAD) - msleep(ie, &ie->ie_lock, curthread->td_priority, - "ithread", 0); + msleep(ie, &ie->ie_lock, 0, "ithread", 0); else { ie->ie_flags |= IE_ADDING_THREAD; mtx_unlock(&ie->ie_lock); @@ -458,8 +457,7 @@ TAILQ_REMOVE(&ie->ie_handlers, handler, ih_next); mtx_unlock_spin(&sched_lock); while (handler->ih_flags & IH_DEAD) - msleep(handler, &ie->ie_lock, curthread->td_priority, "iev_rmh", - 0); + msleep(handler, &ie->ie_lock, 0, "iev_rmh", 0); intr_event_update(ie); #ifdef notyet /* @@ -683,7 +681,7 @@ ie->ie_name); ie->ie_warned = 1; } - tsleep(&ie->ie_count, curthread->td_priority, "istorm", 1); + tsleep(&ie->ie_count, 0, "istorm", 1); } else ie->ie_count++; --- //depot/vendor/freebsd/src/sys/kern/kern_poll.c 2005/10/05 10:11:43 +++ //depot/projects/smpng/sys/kern/kern_poll.c 2006/04/12 19:21:13 @@ -577,13 +577,11 @@ { struct thread *td = curthread; struct rtprio rtp; - int pri; rtp.prio = RTP_PRIO_MAX; /* lowest priority */ rtp.type = RTP_PRIO_IDLE; mtx_lock_spin(&sched_lock); rtp_to_pri(&rtp, td->td_ksegrp); - pri = td->td_priority; mtx_unlock_spin(&sched_lock); for (;;) { @@ -595,7 +593,7 @@ mtx_unlock_spin(&sched_lock); } else { idlepoll_sleeping = 1; - tsleep(&idlepoll_sleeping, pri, "pollid", hz * 3); + tsleep(&idlepoll_sleeping, 0, "pollid", hz * 3); } } } --- //depot/vendor/freebsd/src/sys/kern/kern_synch.c 2006/02/23 00:15:20 +++ //depot/projects/smpng/sys/kern/kern_synch.c 2006/04/12 18:59:16 @@ -195,9 +195,11 @@ /* * Adjust this thread's priority. */ - mtx_lock_spin(&sched_lock); - sched_prio(td, priority & PRIMASK); - mtx_unlock_spin(&sched_lock); + if ((priority & PRIMASK) != 0) { + mtx_lock_spin(&sched_lock); + sched_prio(td, priority & PRIMASK); + mtx_unlock_spin(&sched_lock); + } if (timo && catch) rval = sleepq_timedwait_sig(ident); --- //depot/vendor/freebsd/src/sys/kern/kern_thr.c 2006/02/10 03:35:16 +++ //depot/projects/smpng/sys/kern/kern_thr.c 2006/04/12 19:21:13 @@ -368,8 +368,8 @@ } PROC_LOCK(td->td_proc); if ((td->td_flags & TDF_THRWAKEUP) == 0) - error = msleep((void *)td, &td->td_proc->p_mtx, - td->td_priority | PCATCH, "lthr", hz); + error = msleep((void *)td, &td->td_proc->p_mtx, PCATCH, "lthr", + hz); if (td->td_flags & TDF_THRWAKEUP) { mtx_lock_spin(&sched_lock); td->td_flags &= ~TDF_THRWAKEUP; --- //depot/vendor/freebsd/src/sys/kern/kern_umtx.c 2006/02/04 06:37:30 +++ //depot/projects/smpng/sys/kern/kern_umtx.c 2006/04/12 19:21:13 @@ -168,7 +168,7 @@ while (umtxq_chains[chain].uc_flags & UCF_BUSY) { umtxq_chains[chain].uc_flags |= UCF_WANT; msleep(&umtxq_chains[chain], umtxq_mtx(chain), - curthread->td_priority, "umtxq_busy", 0); + 0, "umtxq_busy", 0); } umtxq_chains[chain].uc_flags |= UCF_BUSY; } @@ -424,8 +424,7 @@ */ umtxq_lock(&uq->uq_key); if (old == owner && (td->td_flags & TDF_UMTXQ)) { - error = umtxq_sleep(td, &uq->uq_key, - td->td_priority | PCATCH, + error = umtxq_sleep(td, &uq->uq_key, PCATCH, "umtx", timo); } umtxq_busy(&uq->uq_key); @@ -547,7 +546,7 @@ umtxq_lock(&uq->uq_key); if (td->td_flags & TDF_UMTXQ) error = umtxq_sleep(td, &uq->uq_key, - td->td_priority | PCATCH, "ucond", 0); + PCATCH, "ucond", 0); if (!(td->td_flags & TDF_UMTXQ)) error = 0; else @@ -560,8 +559,7 @@ for (;;) { umtxq_lock(&uq->uq_key); if (td->td_flags & TDF_UMTXQ) { - error = umtxq_sleep(td, &uq->uq_key, - td->td_priority | PCATCH, + error = umtxq_sleep(td, &uq->uq_key, PCATCH, "ucond", tvtohz(&tv)); } if (!(td->td_flags & TDF_UMTXQ)) { --- //depot/vendor/freebsd/src/sys/kern/sched_4bsd.c 2005/06/24 00:20:45 +++ //depot/projects/smpng/sys/kern/sched_4bsd.c 2006/04/12 19:21:13 @@ -543,7 +543,7 @@ for (;;) { schedcpu(); - tsleep(&nowake, curthread->td_priority, "-", hz); + tsleep(&nowake, 0, "-", hz); } } --- //depot/vendor/freebsd/src/sys/kern/subr_taskqueue.c 2006/01/14 01:55:53 +++ //depot/projects/smpng/sys/kern/subr_taskqueue.c 2006/04/12 19:21:13 @@ -356,7 +356,7 @@ TQ_LOCK(tq); do { taskqueue_run(tq); - TQ_SLEEP(tq, tq, &tq->tq_mutex, curthread->td_priority, "-", 0); + TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); } while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0); /* rendezvous with thread that asked us to terminate */ --- //depot/vendor/freebsd/src/sys/kern/uipc_mqueue.c 2006/03/01 06:30:18 +++ //depot/projects/smpng/sys/kern/uipc_mqueue.c 2006/04/12 19:21:13 @@ -1657,7 +1657,7 @@ } mq->mq_senders++; error = msleep(&mq->mq_senders, &mq->mq_mutex, - curthread->td_priority | PCATCH, "mqsend", timo); + PCATCH, "mqsend", timo); mq->mq_senders--; if (error == EAGAIN) error = ETIMEDOUT; @@ -1809,7 +1809,7 @@ } mq->mq_receivers++; error = msleep(&mq->mq_receivers, &mq->mq_mutex, - curthread->td_priority | PCATCH, "mqrecv", timo); + PCATCH, "mqrecv", timo); mq->mq_receivers--; if (error == EAGAIN) error = ETIMEDOUT; --- //depot/vendor/freebsd/src/sys/vm/vm_zeroidle.c 2005/12/31 14:40:36 +++ //depot/projects/smpng/sys/vm/vm_zeroidle.c 2006/04/12 19:21:13 @@ -140,9 +140,7 @@ static void vm_pagezero(void __unused *arg) { - struct thread *td; - td = curthread; idlezero_enable = idlezero_enable_default; for (;;) { @@ -159,7 +157,7 @@ vm_page_lock_queues(); wakeup_needed = TRUE; msleep(&zero_state, &vm_page_queue_mtx, - PDROP | td->td_priority, "pgzero", hz * 300); + PDROP, "pgzero", hz * 300); } } }