diff options
author | jeff <jeff@FreeBSD.org> | 2003-10-12 21:07:31 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-10-12 21:07:31 +0000 |
commit | bd83534d1134b17b1cce5abf1fa6f97da4fa8c2e (patch) | |
tree | 3710dfd553ed30f9150326fb4748781ada5358a7 | |
parent | dc456661328086df0101a96a1953319de7c0f8e4 (diff) | |
download | FreeBSD-src-bd83534d1134b17b1cce5abf1fa6f97da4fa8c2e.zip FreeBSD-src-bd83534d1134b17b1cce5abf1fa6f97da4fa8c2e.tar.gz |
- In SCHED_CURR() add holding Giant to the list of criteria that will keep
you on the current queue. In the future, it would be nice if priority
propagation could deterministicly pluck a thread off of the next queue
and put it on the current queue. Until then this hack stops us from
holding up our entire current queue, including interrupt handlers, while
a thread on the next queue is blocked while holding Giant.
- Inherit our pctcpu information from our parent.
-rw-r--r-- | sys/kern/sched_ule.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 9fbfb0c..635a0dd 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -182,7 +182,9 @@ struct td_sched *thread0_sched = &td_sched; #define SCHED_INTERACTIVE(kg) \ (sched_interact_score(kg) < SCHED_INTERACT_THRESH) #define SCHED_CURR(kg, ke) \ - (ke->ke_thread->td_priority < PRI_MIN_TIMESHARE || SCHED_INTERACTIVE(kg)) + (ke->ke_thread->td_priority < PRI_MIN_TIMESHARE || \ + SCHED_INTERACTIVE(kg) || \ + mtx_ownedby(&Giant, (ke)->ke_thread)) /* * Cpu percentage computation macros and defines. @@ -925,13 +927,10 @@ sched_fork_kse(struct kse *ke, struct kse *child) child->ke_cpu = ke->ke_cpu; /* sched_pickcpu(); */ child->ke_runq = NULL; - /* - * Claim that we've been running for one second for statistical - * purposes. - */ - child->ke_ticks = 0; - child->ke_ltick = ticks; - child->ke_ftick = ticks - hz; + /* Grab our parents cpu estimation information. */ + child->ke_ticks = ke->ke_ticks; + child->ke_ltick = ke->ke_ltick; + child->ke_ftick = ke->ke_ftick; } void |