summaryrefslogtreecommitdiffstats
path: root/sys/ddb/db_ps.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-10-09 02:33:36 +0000
committerjulian <julian@FreeBSD.org>2002-10-09 02:33:36 +0000
commit6b6ba96b60d9de6b157e3a804963854cde6eec5b (patch)
tree93491b956e59fcfe0f873643838ff7944a49abe7 /sys/ddb/db_ps.c
parent03d461282bdbbe2384e949089d84ae6a3821e7ca (diff)
downloadFreeBSD-src-6b6ba96b60d9de6b157e3a804963854cde6eec5b.zip
FreeBSD-src-6b6ba96b60d9de6b157e3a804963854cde6eec5b.tar.gz
Round out the facilty for a 'bound' thread to loan out its KSE
in specific situations. The owner thread must be blocked, and the borrower can not proceed back to user space with the borrowed KSE. The borrower will return the KSE on the next context switch where teh owner wants it back. This removes a lot of possible race conditions and deadlocks. It is consceivable that the borrower should inherit the priority of the owner too. that's another discussion and would be simple to do. Also, as part of this, the "preallocatd spare thread" is attached to the thread doing a syscall rather than the KSE. This removes the need to lock the scheduler when we want to access it, as it's now "at hand". DDB now shows a lot mor info for threaded proceses though it may need some optimisation to squeeze it all back into 80 chars again. (possible JKH project) Upcalls are now "bound" threads, but "KSE Lending" now means that other completing syscalls can be completed using that KSE before the upcall finally makes it back to the UTS. (getting threads OUT OF THE KERNEL is one of the highest priorities in the KSE system.) The upcall when it happens will present all the completed syscalls to the KSE for selection.
Diffstat (limited to 'sys/ddb/db_ps.c')
-rw-r--r--sys/ddb/db_ps.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
index 26dc00b..8ddaaaf 100644
--- a/sys/ddb/db_ps.c
+++ b/sys/ddb/db_ps.c
@@ -127,7 +127,7 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
db_printf("(threaded) %s\n", p->p_comm);
FOREACH_THREAD_IN_PROC(p, td) {
if (p->p_flag & P_KSES)
- db_printf( " thread %p ", td);
+ db_printf( " thread %p ksegrp %p ", td, td->td_ksegrp);
if (TD_ON_SLEEPQ(td)) {
if (td->td_flags & TDF_CVWAITQ)
db_printf("[CVQ ");
@@ -155,6 +155,9 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
if (TD_AWAITING_INTR(td)) {
db_printf("[IWAIT]");
}
+ if (TD_LENT(td)) {
+ db_printf("[LOAN]");
+ }
break;
case TDS_CAN_RUN:
db_printf("[Can run]");
@@ -168,9 +171,11 @@ db_ps(dummy1, dummy2, dummy3, dummy4)
default:
panic("unknown thread state");
}
- if (p->p_flag & P_KSES)
+ if (p->p_flag & P_KSES) {
+ if (td->td_kse)
+ db_printf("[kse %p]", td->td_kse);
db_printf("\n");
- else
+ } else
db_printf(" %s\n", p->p_comm);
}
OpenPOWER on IntegriCloud