summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_condvar.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-12-28 01:23:07 +0000
committerjulian <julian@FreeBSD.org>2002-12-28 01:23:07 +0000
commitdde96893c92bc25fb17bdfa957ab33af10fcd5b9 (patch)
tree34088f29c02f6a4d56466e7db0deb792a033cebc /sys/kern/kern_condvar.c
parentf142c827ba04af2b614cc0c982e33765b2903821 (diff)
downloadFreeBSD-src-dde96893c92bc25fb17bdfa957ab33af10fcd5b9.zip
FreeBSD-src-dde96893c92bc25fb17bdfa957ab33af10fcd5b9.tar.gz
Add code to ddb to allow backtracing an arbitrary thread.
(show thread {address}) Remove the IDLE kse state and replace it with a change in the way threads sahre KSEs. Every KSE now has a thread, which is considered its "owner" however a KSE may also be lent to other threads in the same group to allow completion of in-kernel work. n this case the owner remains the same and the KSE will revert to the owner when the other work has been completed. All creations of upcalls etc. is now done from kse_reassign() which in turn is called from mi_switch or thread_exit(). This means that special code can be removed from msleep() and cv_wait(). kse_release() does not leave a KSE with no thread any more but converts the existing thread into teh KSE's owner, and sets it up for doing an upcall. It is just inhibitted from being scheduled until there is some reason to do an upcall. Remove all trace of the kse_idle queue since it is no-longer needed. "Idle" KSEs are now on the loanable queue.
Diffstat (limited to 'sys/kern/kern_condvar.c')
-rw-r--r--sys/kern/kern_condvar.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c
index e2bb544..d36b0c1 100644
--- a/sys/kern/kern_condvar.c
+++ b/sys/kern/kern_condvar.c
@@ -116,26 +116,6 @@ cv_destroy(struct cv *cvp)
static __inline void
cv_switch(struct thread *td)
{
-
- /*
- * If we are capable of async syscalls and there isn't already
- * another one ready to return, start a new thread
- * and queue it as ready to run. Note that there is danger here
- * because we need to make sure that we don't sleep allocating
- * the thread (recursion here might be bad).
- * Hence the TDF_INMSLEEP flag.
- */
- if ((td->td_flags & (TDF_UNBOUND|TDF_INMSLEEP)) == TDF_UNBOUND) {
- /*
- * We don't need to upcall now, just queue it.
- * The upcall will happen when other n-kernel work
- * in this SKEGRP has completed.
- * Don't recurse here!
- */
- td->td_flags |= TDF_INMSLEEP;
- thread_schedule_upcall(td, td->td_kse);
- td->td_flags &= ~TDF_INMSLEEP;
- }
TD_SET_SLEEPING(td);
td->td_proc->p_stats->p_ru.ru_nvcsw++;
mi_switch();
OpenPOWER on IntegriCloud