diff options
author | julian <julian@FreeBSD.org> | 2004-10-05 21:10:44 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2004-10-05 21:10:44 +0000 |
commit | 7b170fd9fa203dd45f0e476e3c479181f9ceb2f7 (patch) | |
tree | 68aa2dbaf19404b35d832a0466bffd8081c3d081 /sys/kern/kern_switch.c | |
parent | 8587c9806d6a780c141ff151e28c2fff6bb3160f (diff) | |
download | FreeBSD-src-7b170fd9fa203dd45f0e476e3c479181f9ceb2f7.zip FreeBSD-src-7b170fd9fa203dd45f0e476e3c479181f9ceb2f7.tar.gz |
Use some macros to trach available scheduler slots to allow
easier debugging.
MFC after: 4 days
Diffstat (limited to 'sys/kern/kern_switch.c')
-rw-r--r-- | sys/kern/kern_switch.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/kern_switch.c b/sys/kern/kern_switch.c index 787ec45..2851ab8 100644 --- a/sys/kern/kern_switch.c +++ b/sys/kern/kern_switch.c @@ -372,7 +372,7 @@ setrunqueue(struct thread *td, int flags) sched_rem(tda); tda = kg->kg_last_assigned = TAILQ_PREV(tda, threadqueue, td_runq); - kg->kg_avail_opennings++; + SLOT_RELEASE(kg); } /* @@ -820,6 +820,7 @@ void sched_init_concurrency(struct ksegrp *kg) { + CTR1(KTR_RUNQ,"kg %p init slots and concurrency to 1", kg); kg->kg_concurrency = 1; kg->kg_avail_opennings = 1; } @@ -836,7 +837,11 @@ void sched_set_concurrency(struct ksegrp *kg, int concurrency) { - /* Handle the case for a declining concurrency */ + CTR4(KTR_RUNQ,"kg %p set concurrency to %d, slots %d -> %d", + kg, + concurrency, + kg->kg_avail_opennings, + kg->kg_avail_opennings + (concurrency - kg->kg_concurrency)); kg->kg_avail_opennings += (concurrency - kg->kg_concurrency); kg->kg_concurrency = concurrency; } @@ -854,7 +859,7 @@ void sched_thread_exit(struct thread *td) { - td->td_ksegrp->kg_avail_opennings++; + SLOT_RELEASE(td->td_ksegrp); slot_fill(td->td_ksegrp); } |