diff options
author | John Baldwin <jhb@FreeBSD.org> | 2004-02-27 18:52:44 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2004-02-27 18:52:44 +0000 |
commit | 44f3b092046e00f7c2d6aefa6946c55305858929 (patch) | |
tree | 9be3a10cadbedab600bc4afc5e50485db5af931f /sys/ddb/db_ps.c | |
parent | e5bb601d876e7b6c83f20153df48a100d0ce71d6 (diff) | |
download | src-44f3b092046e00f7c2d6aefa6946c55305858929.tar.gz src-44f3b092046e00f7c2d6aefa6946c55305858929.zip |
Switch the sleep/wakeup and condition variable implementations to use the
sleep queue interface:
- Sleep queues attempt to merge some of the benefits of both sleep queues
and condition variables. Having sleep qeueus in a hash table avoids
having to allocate a queue head for each wait channel. Thus, struct cv
has shrunk down to just a single char * pointer now. However, the
hash table does not hold threads directly, but queue heads. This means
that once you have located a queue in the hash bucket, you no longer have
to walk the rest of the hash chain looking for threads. Instead, you have
a list of all the threads sleeping on that wait channel.
- Outside of the sleepq code and the sleep/cv code the kernel no longer
differentiates between cv's and sleep/wakeup. For example, calls to
abortsleep() and cv_abort() are replaced with a call to sleepq_abort().
Thus, the TDF_CVWAITQ flag is removed. Also, calls to unsleep() and
cv_waitq_remove() have been replaced with calls to sleepq_remove().
- The sched_sleep() function no longer accepts a priority argument as
sleep's no longer inherently bump the priority. Instead, this is soley
a propery of msleep() which explicitly calls sched_prio() before
blocking.
- The TDF_ONSLEEPQ flag has been dropped as it was never used. The
associated TDF_SET_ONSLEEPQ and TDF_CLR_ON_SLEEPQ macros have also been
dropped and replaced with a single explicit clearing of td_wchan.
TD_SET_ONSLEEPQ() would really have only made sense if it had taken
the wait channel and message as arguments anyway. Now that that only
happens in one place, a macro would be overkill.
Notes
Notes:
svn path=/head/; revision=126326
Diffstat (limited to 'sys/ddb/db_ps.c')
-rw-r--r-- | sys/ddb/db_ps.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index d12b250d88dd..9c780a7122dd 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -126,20 +126,8 @@ dumpthread(volatile struct proc *p, volatile struct thread *td) if (p->p_flag & P_SA) db_printf( " thread %p ksegrp %p ", td, td->td_ksegrp); - if (TD_ON_SLEEPQ(td)) { - if (td->td_flags & TDF_CVWAITQ) - if (TD_IS_SLEEPING(td)) - db_printf("[CV]"); - else - db_printf("[CVQ"); - else - if (TD_IS_SLEEPING(td)) - db_printf("[SLP]"); - else - db_printf("[SLPQ"); - db_printf("%s %p]", td->td_wmesg, - (void *)td->td_wchan); - } + if (TD_ON_SLEEPQ(td)) + db_printf("[SLPQ %s %p]", td->td_wmesg, (void *)td->td_wchan); switch (td->td_state) { case TDS_INHIBITED: if (TD_ON_LOCK(td)) { @@ -147,11 +135,9 @@ dumpthread(volatile struct proc *p, volatile struct thread *td) td->td_lockname, (void *)td->td_blocked); } -#if 0 /* covered above */ if (TD_IS_SLEEPING(td)) { db_printf("[SLP]"); } -#endif if (TD_IS_SWAPPED(td)) { db_printf("[SWAP]"); } |