summaryrefslogtreecommitdiffstats
path: root/sys/kern/sched_ule.c
Commit message (Collapse)AuthorAgeFilesLines
* Add lock assertions for various proc/thread/kse/ksegroup fields to thejhb2003-04-231-0/+4
| | | | scheduler functions.
* - Assert that the proc lock and sched_lock are held in sched_nice().jhb2003-04-221-0/+2
| | | | | | - For the 4BSD scheduler, this means that all callers of the static function resetpriority() now always hold sched_lock, so don't lock sched_lock explicitly in that function.
* Protect p_swtime with the sched_lock.jhb2003-04-221-0/+2
|
* - Set the ke_cpu field in sched_add() for interrupt and realtime threadsjeff2003-04-181-5/+7
| | | | | | | | | | since they are going on the current cpu and not their previously assigned cpu. - sched_runnable() should only return true in the SMP case if the other processor has more than one thread that is runnable. We can not steal curthread. - Change kseq_print() to accept the cpuid instead of a kseq pointer. This makes use of this function in ddb much easier.
* - Unbreak priority prop. for timeshare threads. Always place something onjeff2003-04-121-3/+1
| | | | | | | | the current queue if its priority is really elevated. This needs more work as there are cases where a next queue kse could be holding up what would be a curr queue kse, and thus hurting interactivity. Also, when a thread with an elevated priority has its priority lowered it should be placed back on the next queue.
* - Clean up some debug code left over from my earlier megacommit.jeff2003-04-121-17/+8
|
* - We only care about the base priority. Ignore the SCHED_FIFO_BIT so thatjeff2003-04-121-5/+5
| | | | | | we dont get confused. Reported and debugged by: Steve Kargl <sgk@troutmask.apl.washington.edu>
* - Add sched_exit_*jeff2003-04-111-6/+17
| | | | - Call sched_exit_kse() from sched_exit() instead of implementing it here.
* - Only select kseqs with more than one kse to steal. The running ksejeff2003-04-111-1/+1
| | | | is reflected in the load now and you can't very well migrate that.
* - When migrating a kse from one kseq to the next actually insert it ontojeff2003-04-111-22/+19
| | | | | | | | the second kseq's run queue so that it is referenced by the kse when it is switched out. - Spell ksq_rslices properly. Reported by: Ian Freislich <ianf@za.uu.net>
* - Add a SYSCTL node for the ule scheduler.jeff2003-04-111-300/+406
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allow user adjustable min and max time slices (suggested by hiten). - Change the SLP_RUN_MAX to 100ms from 2 seconds so that we learn whether a process is interactive or not much more quickly. - Place a process on the current run queue if it is interactive or if it is running at an interrupt thread priority due to priority prop. - Use the 'current' timeshare queue for interrupt threads, realtime threads, and idle threads that are running at higher priority due to priority prop. This fixes problems where priorities would have been elevated but we would not check the timeshare run queue until other lower priority tasks were no longer runnable. - Keep an array of loads indexed by the priority class as well as a global load. - Keep an bucket of nice values with a count of the number of kses currently runnable with that nice value. - Keep track of the minimum nice value of any running thread. - Remove the unused short term sleep accounting. I was attempting to use this for load balancing but it didn't work out. - Define a kseq_print() for use with debugging. - Add KTR debugging at useful places so we can easily debug slice and priority assignment. - Decouple the runq assignment from the kseq assignment. kseq_add now keeps track of statistics. This is done so that the nice and load is still tracked for the currently running process. Previously if a niced process was added while a non nice process was running the niced process would still get a slice since it was not aware of the unnice process. - Make adjustments for the sched api changes.
* Move the _oncpu entry from the KSE to the thread.julian2003-04-101-3/+3
| | | | | The entry in the KSE still exists but it's purpose will change a bit when we add the ability to lock a KSE to a cpu.
* - Keep seperate statistics and run queues for different scheduling classes.jeff2003-04-031-48/+134
| | | | | | | | - Treat each class specially in kseq_{choose,add,rem}. Let the rest of the code be less aware of scheduling classes. - Skip the interactivity calculation for non TIMESHARE ksegrps. - Move slice and runq selection into kseq_add(). Uninline it now that it's big.
* - Make the interactivity calculator decay faster.jeff2003-04-021-2/+2
| | | | - Make the pcpu estimator update faster.
* - I meant divide by two and not shift by two in SCHED_PRI_NHALF.jeff2003-04-021-1/+1
|
* - Add in support for KSEs with 0 slice values on the run queue. If we tryjeff2003-04-021-34/+90
| | | | | | | | | | | | | | | | to select a KSE with a slice of 0 we will update its slice and insert it onto the next queue. - Pass the KSE instead of the ksegrp into sched_slice(). This more accurately reflects the behavior of the code. Slices are granted to kses. - Add a function kseq_nice_min() which finds the smallest nice value assigned to the kseg of any KSE on the queue. - Rewrite the logic in sched_slice(). Add a large comment describing the new slice selection scheme. To summarize, slices are assigned based on the nice value. Priorities are still calculated based on the nice and interactivity of a process. Slice sizes of 0 may be granted for KSEs whos nice is 20 or futher away from the lowest nice on the run queue. Other nice values are scaled across the range [min, min+20]. This fixes ULEs bad behavior with positively niced processes.
* - Create a function sched_interact_score() which decides on thejeff2003-03-041-70/+86
| | | | | | | | | interactivity of a kseg and assigns it a value of 0 through 100. - Use sched_interact_score() to determine the dynamic priority. - Define SCHED_CURR() in terms of sched_interact_score(). - Adjust the maximum slice back down to 100ms. - Remove redundant clearing of ke_runq in sched_wakeup() - Clean up #defines and comment them.
* - Shift the tick count by 10 and back around sched_pctcpu_update()jeff2003-03-031-2/+8
| | | | | | | calculations. Keep this changes local to the function so the tick count is in its natural form otherwise. Previously 1000 was added each time a tick fired and we divided by 1000 when it was reported. This is done to reduce rounding errors.
* - In sched_add() special case PRI_TIMESHARE and PRI_ITHD|PRI_REALTIME. Wejeff2003-03-031-9/+22
| | | | | | always place ITHD & REALTIME threads on the current queue of the current cpu. Prior to this change an interrupt thread would only ever run on one cpu.
* - Refrain from setting the td_priority in sched_wakeup(). It will be resetjeff2003-03-031-6/+5
| | | | before we return to user space.
* Change the process flags P_KSES to be P_THREADED.julian2003-02-271-1/+1
| | | | This is just a cosmetic change but I've been meaning to do it for about a year.
* Move a bunch of flags from the KSE to the thread.julian2003-02-171-6/+6
| | | | | | | | I was in two minds as to where to put them in the first case.. I should have listenned to the other mind. Submitted by: parts by davidxu@ Reviewed by: jeff@ mini@
* - Enable STRICT_RESCHED until code that dynamically decides on reschedjeff2003-02-101-0/+2
| | | | strictness based on the current workload is finished.
* - Add a new variable 'kg_runtime' that tracks the amount of time we've run.jeff2003-02-101-25/+66
| | | | | | | | | - Use the ratio of kg_runtime / kg_slptime to determine our dynamic priority. - Scale kg_runtime and kg_slptime back when the sum of the two exceeds SCHED_SLP_RUN_MAX. This allows us to slowly forget old behavior. - Scale back the runtime and slptime in fork so that the new process has the same ratio but much less accumulated time. This causes new behavior to be noticed more quickly.
* - Make some context switches conditional on SCHED_STRICT_RESCHED. This mayjeff2003-02-031-62/+146
| | | | | | | | | | have some negative effect on interactivity but it yields great perf. gains. This also brings the conditions under which ULE context switches inline with SCHED_4BSD. - Define some new kseq_* functions for manipulating the run queue. - Add a new kseq member ksq_rslices and ksq_bload. rslices is the sum of the slices of runnable kses. This will be used for push load balance decisions. bload is the number of threads blocked waiting on IO.
* - Stop abusing oncpu for our cpu binding. Define a scheduler local elementjeff2003-02-031-11/+14
| | | | | in the kse datastructure called ke_cpu. This is the cpu which we are currently bound to. Some flags may be added later to support hard binding.
* Use hz if stathz is zero. Adopted from sched_4bsd.scottl2003-02-021-1/+3
|
* - Use ksq_load as the authoritive count of kses on the pair of kseqs forjeff2003-01-291-84/+79
| | | | | | | | sched_runnable() et all. - Remove some dead code in sched_clock(). - Define two macros KSEQ_SELF() and KSEQ_CPU() for getting the kseq of the current cpu or some alternate cpu. - Start introducing kseq_() functions, such as kseq_choose() and kseq_setup().
* - Remove debugging code that didn't work on UP.jeff2003-01-291-44/+0
|
* - Allow idle's pctcpu time to be calculated.jeff2003-01-281-6/+6
|
* - Fix the ksq_load calculation. It now reflects the number of entries on thejeff2003-01-281-27/+134
| | | | | | | | run queue for each cpu. - Introduce kse stealing into the sched_choose() code. This helps balance cpus better in cases where process turnover is high. This implementation is fairly trivial and will likely be only a temporary measure until something more sophisticated has been written.
* - Add the ule scheduler. This is intended to be a general purpose processjeff2003-01-261-0/+697
scheduler with many SMP benefits. It is still very experimental and should be used only in test environments.
OpenPOWER on IntegriCloud