aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
Commit message (Collapse)AuthorAge
* cleanup: tidy up code before release2007.2Bjoern B. Brandenburg2007-10-27
| | | This gets rid of quite a few FIXMEs and TODOs, as well as some cruft.
* litmus-core: add scheduler_signal() infrastructureBjoern B. Brandenburg2007-10-09
| | | | use it to send weight change notifications
* Cleanup: Get rid of unneeded algo_tick indirection.Bjoern B. Brandenburg2007-10-04
| | | | | Since all plugins use rt_scheduler_tick() anyway, we might as well get rid of the field.
* add flag based np-sectionsBjoern B. Brandenburg2007-09-13
| | | | | | This commit introduces the infrastructure for flag based np sections. It also features an overhauled GSN-EDF scheduler that respects the flags (and has less bugs).
* Place trigger for scheduling overhead benchmark.Bjoern B. Brandenburg2007-05-16
|
* Add time stamps for schedule(), the timer interrupt, and the pluginBjoern B. Brandenburg2007-05-16
| | | | scheduler_tick() and schedule() callbacks.
* Fix try_to_wake_up() for RT tasks if it races with schedule.Bjoern B. Brandenburg2007-05-15
| | | | | We need to set the task state to TASK_RUNNING if it races, otherwise the task might get lost once it gets de-scheduled.
* First part of the PI semaphore implementation.Bjoern B. Brandenburg2007-05-14
| | | | | | | | | | | - move struct pi_semaphore to place where it makes more sense (not included everywhere) - change semantics of scheduler plugin callbacks and add comments - remove old unneeded code - compile fixes Note: The plugins don't actually work yet, since the semantics of the callbacks have changed. That will be fixed in the next patch.
* Reimplemented LITMUS standard FIFO semaphores + misc fixesBjoern B. Brandenburg2007-05-14
| | | | | | | This version is much more straightforward than the last one and actually enforces FIFO order in all cases. Further, it removes the need for the sem_wake_up() calls by providing a custom wake up function for the wait queue.
* TRACE RT task arrivals and departures.Bjoern B. Brandenburg2007-05-13
|
* Another development update. Things seem to be working better now, but IJohn M. Calandrino2007-05-09
| | | | don't have FIFO ordering yet.
* Development checkpoint. Still having issues.John M. Calandrino2007-05-09
|
* Various changes that I don't want to lose, but the code does not work.John M. Calandrino2007-05-09
|
* Some changes so that semaphores use correct wakeup functions.John M. Calandrino2007-05-03
|
* Made changes to protect empty queues from being traversed inJohn M. Calandrino2007-04-26
| | | | semaphore-related calls.
* Fixed handling of changes in task priorities due to PI in GSN-EDF.John M. Calandrino2007-04-25
|
* Removed incomplete zone-based implementation.John M. Calandrino2007-04-25
|
* Fixed a few comment inconsistencies. Added stubs for an SRP "semaphore",John M. Calandrino2007-04-25
| | | | | which needs to be expanded in the LSO and by adding system call numbers in kernel space.
* Fixed GSN-EDF to handle correct wakeup of tasks that just exited aJohn M. Calandrino2007-04-24
| | | | semaphore.
* Fixed a number of issues, subtle and otherwise, with PI semaphores.John M. Calandrino2007-04-24
| | | | | | | | | | PI semaphores now use scheduler callbacks to update priority on a down or up call. Issues with calling down/up and not calling __down_failed or __up_wakeup for PI semaphores has been noted (since priority-related things occured in those calls) and up has been fixed (down is in process). Callbacks are now responsible for the priority checks and updates, and some subtle cases are handled that were missed before. Still need to finish handling GSN-EDF implementation issues related to suspensions.
* Reverted back to spinlocks, added code to higher priority code inJohn M. Calandrino2007-04-23
| | | | edf-common.c, left other stubs untouched until tomorrow.
* Converting spinlocks to queuelocks in my code, and also fixing stubs... inJohn M. Calandrino2007-04-23
| | | | process...
* Merge with git+ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/litmusJohn M. Calandrino2007-04-23
|\ | | | | | | | | Bjoern's changes + mine. Still need to fill in some stubs and ensure that nothing broke.
| * Call curr_plugin->finish_switch() after every task switch.Bjoern B. Brandenburg2007-04-17
| | | | | | | | | | GSN-EDF needs to be called after every task switch. This patch changes the existing plugins to handle the changed behavior.
* | Fixed priority inheritance issues with PI semaphores. Added regularJohn M. Calandrino2007-04-23
| | | | | | | | | | semaphores accessible through system calls, so that they can be used with the LSO (for partitioned FMLP).
* | Added a way for tasks to see what their current priority is due to priorityJohn M. Calandrino2007-04-19
| | | | | | | | inheritance.
* | Added priority inheritance within semaphores - compiles but has not beenJohn M. Calandrino2007-04-18
| | | | | | | | tested.
* | Added stubs for modifying "semaphore" priority, in order to facilitateJohn M. Calandrino2007-04-18
|/ | | | | | | priority inheritance. Also fixed a few bugs. Many files were modified, as the PI semaphores were are implementing replicate much of the original Linux semaphore implementation with minor changes, often causing a cascade of changes as functions were chased down and changed in several files.
* use same variable as standard Linux for checking task stateBjoern B. Brandenburg2007-02-22
|
* Fix a bunch of bugs that crept in while porting.Bjoern Brandenburg2007-02-05
| | | | | | | | * Our old clone flag is already taken in 2.6.20. * Fix wrong is_running() macro. * Remove double ->finish_switch() call. * Move sched_trace_scheduled to non-preemtible section. * Allow next = idle task in RT mode.
* patched up schedule()Bjoern B. Brandenburg2007-02-02
| | | | | | As we currently do not support direct switching, I removed the DIRECT_SWITCH option. Migration is still supported but only if not in RT mode. This may have to be checked again.
* scheduler_tick patched upBjoern B. Brandenburg2007-02-02
|
* patched up sched.c except for scheduler_tick and scheduleBjoern B. Brandenburg2007-02-02
|
* resolve problems with conflicting function definitions inBjoern B. Brandenburg2007-02-02
| | | | sched.c
* ported first pluginBjoern Brandenburg2007-02-01
| | | | doesn't work yet, no hooks in sched.c yet
* plugin driver added and compilesBjoern B. Brandenburg2007-02-01
|
* [PATCH] sched: tasks cannot run on cpus onlined after bootNathan Lynch2007-01-11
| | | | | | | | | | | | | | | | | | | | | Commit 5c1e176781f43bc902a51e5832f789756bff911b ("sched: force /sbin/init off isolated cpus") sets init's cpus_allowed to a subset of cpu_online_map at boot time, which means that tasks won't be scheduled on cpus that are added to the system later. Make init's cpus_allowed a subset of cpu_possible_map instead. This should still preserve the behavior that Nick's change intended. Thanks to Giuliano Pochini for reporting this and testing the fix: http://ozlabs.org/pipermail/linuxppc-dev/2006-December/029397.html Signed-off-by: Nathan Lynch <ntl@pobox.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: fix cond_resched_softirq() offsetIngo Molnar2006-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | Remove the __resched_legal() check: it is conceptually broken. The biggest problem it had is that it can mask buggy cond_resched() calls. A cond_resched() call is only legal if we are not in an atomic context, with two narrow exceptions: - if the system is booting - a reacquire_kernel_lock() down() done while PREEMPT_ACTIVE is set But __resched_legal() hid this and just silently returned whenever these primitives were called from invalid contexts. (Same goes for cond_resched_locked() and cond_resched_softirq()). Furthermore, the __legal_resched(0) call was buggy in that it caused unnecessarily long softirq latencies via cond_resched_softirq(). (which is only called from softirq-off sections, hence the code did nothing.) The fix is to resurrect the efficiency of the might_sleep checks and to only allow the narrow exceptions. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: remove __cpuinitdata anotation to cpu_isolated_mapTim Chen2006-12-22
| | | | | | | | | | | | | | The structure cpu_isolated_map is used not only during initialization. Multi-core scheduler configuration changes and exclusive cpusets use this during run time. During setting of sched_mc_power_savings policy, this structure is accessed to update sched_domains. Signed-off-by: Tim Chen <tim.c.chen@intel.com> Acked-by: Suresh Siddha <suresh.b.siddha@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] Conditionally check expected_preempt_count in __resched_legal()Mark Fasheh2006-12-22
| | | | | | | | | | | | | | | | | | | | | | Commit 2d7d253548cffdce80f4e03664686e9ccb1b0ed7 ("fix cond_resched() fix") introduced an 'expected_preempt_count' parameter to __resched_legal() to fix a bug where it was returning a false negative when called from cond_resched_lock() and preemption was enabled. Unfortunately this broke things for when preemption is disabled. preempt_count() will always return zero, thus failing the check against any value of expected_preempt_count not equal to zero. cond_resched_lock() for example, passes an expected_preempt_count value of 1. So fix the fix for the cond_resched() fix by skipping the check of preempt_count() against expected_preempt_count when preemption is disabled. Credit should go to Sunil Mushran for spotting the bug during testing. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: improve efficiency of sched_fork()Peter Williams2006-12-21
| | | | | | | | | | | | | | | | | | | | | | Problem: sched_fork() has always called scheduler_tick() in some (unlikely) circumstances in order to update the current task in light of those circumstances. It has always been the case that the work done by scheduler_tick() was more than was required to handle the problem in hand but no harm was done except for the waste of a few CPU cycles. However, the splitting of scheduler_tick() into two procedures in 2.6.20-rc1 enables the wasted cycles to be saved as the new procedure task_running_tick() does all the work that is required to rectify the problem being handled. Solution: Replace the call to scheduler_tick() in sched_fork() with a call to task_running_tick(). Signed-off-by: Peter Williams <pwil3058@bigpond.com.au> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] lockdep: print irq-trace info on assertsIngo Molnar2006-12-13
| | | | | | | | | | | | When we print an assert due to scheduling-in-atomic bugs, and if lockdep is enabled, then the IRQ tracing information of lockdep can be printed to pinpoint the code location that disabled interrupts. This saved me quite a bit of debugging time in cases where the backtrace did not identify the irq-disabling site well enough. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] kernel/sched.c: whitespace cleanupsMiguel Ojeda Sandonis2006-12-10
| | | | | | | | | [akpm@osdl.org: additional cleanups] Signed-off-by: Miguel Ojeda Sandonis <maxextreme@gmail.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: optimize activate_task for RT taskChen, Kenneth W2006-12-10
| | | | | | | | | | | | | | RT task does not participate in interactiveness priority and thus shouldn't be bothered with timestamp and p->sleep_type manipulation when task is being put on run queue. Bypass all of the them with a single if (rt_task) test. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: remove lb_stopbalance counterChen, Kenneth W2006-12-10
| | | | | | | | | | | | Remove scheduler stats lb_stopbalance counter. This counter can be calculated by: lb_balanced - lb_nobusyg - lb_nobusyq. There is no need to create gazillion counters while we can derive the value. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: decrease number of load balancesSiddha, Suresh B2006-12-10
| | | | | | | | | | | | | | | | | | | | Currently at a particular domain, each cpu in the sched group will do a load balance at the frequency of balance_interval. More the cores and threads, more the cpus will be in each sched group at SMP and NUMA domain. And we endup spending quite a bit of time doing load balancing in those domains. Fix this by making only one cpu(first idle cpu or first cpu in the group if all the cpus are busy) in the sched group do the load balance at that particular sched domain and this load will slowly percolate down to the other cpus with in that group(when they do load balancing at lower domains). Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Christoph Lameter <clameter@engr.sgi.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: improve migration accuracyMike Galbraith2006-12-10
| | | | | | | | | | | | | | | | | | | | | Co-opt rq->timestamp_last_tick to maintain a cache_hot_time evaluation reference timestamp at both tick and sched times to prevent said reference, formerly rq->timestamp_last_tick, from being behind task->last_ran at evaluation time, and to move said reference closer to current time on the remote processor, intent being to improve cache hot evaluation and timestamp adjustment accuracy for task migration. Fix minor sched_time double accounting error which occurs when a task passing through schedule() does not schedule off, and takes the next timer tick. [kenneth.w.chen@intel.com: cleanup] Signed-off-by: Mike Galbraith <efault@gmx.de> Acked-by: Ingo Molnar <mingo@elte.hu> Acked-by: Ken Chen <kenneth.w.chen@intel.com> Cc: Don Mullis <dwm@meer.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: add option to serialize load balancingChristoph Lameter2006-12-10
| | | | | | | | | | | | | | | | | | Large sched domains can be very expensive to scan. Add an option SD_SERIALIZE to the sched domain flags. If that flag is set then we make sure that no other such domain is being balanced. [akpm@osdl.org: build fix] Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Peter Williams <pwil3058@bigpond.net.au> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Christoph Lameter <clameter@sgi.com> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com> Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: call tasklet less frequentlyChristoph Lameter2006-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trigger softirq less frequently We trigger the softirq before this patch using offset of sd->interval. However, if the queue is busy then it is sufficient to schedule the softirq with sd->interval * busy_factor. So we modify the calculation of the next time to balance by taking the interval added to last_balance again. This is only the right value if the idle/busy situation continues as is. There are two potential trouble spots: - If the queue was idle and now gets busy then we call rebalance early. However, that is not a problem because we will then use the longer interval for the next period. - If the queue was busy and becomes idle then we potentially wait too long before rebalancing. However, when the task goes idle then idle_balance is called. We add another calculation of the next balance time based on sd->interval in idle_balance so that we will rebalance soon. V2->V3: - Calculate rebalance time based on current jiffies and not based on the jiffies at the last time we load balanced. We no longer rely on staggering and therefore we can affort to do this now. V3->V4: - Use functions to do jiffy comparisons. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Peter Williams <pwil3058@bigpond.net.au> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Christoph Lameter <clameter@sgi.com> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com> Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] sched: use softirq for load balancingChristoph Lameter2006-12-10
| | | | | | | | | | | | | | | | | | | | Call rebalance_tick (renamed to run_rebalance_domains) from a newly introduced softirq. We calculate the earliest time for each layer of sched domains to be rescanned (this is the rescan time for idle) and use the earliest of those to schedule the softirq via a new field "next_balance" added to struct rq. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Peter Williams <pwil3058@bigpond.net.au> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Christoph Lameter <clameter@sgi.com> Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com> Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com> Acked-by: Ingo Molnar <mingo@elte.hu> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>