aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-schedLinus Torvalds2007-10-1525-1288/+1872
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched: (140 commits) sched: sync wakeups preempt too sched: affine sync wakeups sched: guest CPU accounting: maintain guest state in KVM sched: guest CPU accounting: maintain stats in account_system_time() sched: guest CPU accounting: add guest-CPU /proc/<pid>/stat fields sched: guest CPU accounting: add guest-CPU /proc/stat field sched: domain sysctl fixes: add terminator comment sched: domain sysctl fixes: do not crash on allocation failure sched: domain sysctl fixes: unregister the sysctl table before domains sched: domain sysctl fixes: use for_each_online_cpu() sched: domain sysctl fixes: use kcalloc() Make scheduler debug file operations const sched: enable wake-idle on CONFIG_SCHED_MC=y sched: reintroduce topology.h tunings sched: allow the immediate migration of cache-cold tasks sched: debug, improve migration statistics sched: debug: increase width of debug line sched: activate task_hot() only on fair-scheduled tasks sched: reintroduce cache-hot affinity sched: speed up context-switches a bit ...
| * sched: sync wakeups preempt tooIngo Molnar2007-10-151-10/+1
| | | | | | | | | | | | | | | | | | | | make sure sync wakeups preempt too - the scheduler will not overschedule as we've got various throttles against that. As a result, sync wakeups can be used more widely in the kernel (to signal wakeup affinity between tasks), and no arbitrary latencies will be introduced either. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: affine sync wakeupsIngo Molnar2007-10-153-6/+12
| | | | | | | | | | | | | | | | make sync wakeups affine for cache-cold tasks: if a cache-cold task is woken up by a sync wakeup then use the opportunity to migrate it straight away. (the two tasks are 'related' because they communicate) Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: guest CPU accounting: maintain guest state in KVMLaurent Vivier2007-10-152-0/+12
| | | | | | | | | | | | | | | | | | | | Modify KVM to update guest time accounting. [ mingo@elte.hu: ported to 2.6.24 KVM. ] Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Acked-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: guest CPU accounting: maintain stats in account_system_time()Laurent Vivier2007-10-152-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modify account_system_time() to add cputime to cpustat->guest if we are running a VCPU. We add this cputime to cpustat->user instead of cpustat->system because this part of KVM code is in fact user code although it is executed in the kernel. We duplicate VCPU time between guest and user to allow an unmodified "top(1)" to display correct value. A modified "top(1)" is able to display good cpu user time and cpu guest time by subtracting cpu guest time from cpu user time. Update "gtime" in task_struct accordingly. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Acked-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: guest CPU accounting: add guest-CPU /proc/<pid>/stat fieldsLaurent Vivier2007-10-154-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | like for cpustat, introduce the "gtime" (guest time of the task) and "cgtime" (guest time of the task children) fields for the tasks. Modify signal_struct and task_struct. Modify /proc/<pid>/stat to display these new fields. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Acked-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: guest CPU accounting: add guest-CPU /proc/stat fieldLaurent Vivier2007-10-152-4/+12
| | | | | | | | | | | | | | | | | | | | | | as recent CPUs introduce a third running state, after "user" and "system", we need a new field, "guest", in cpustat to store the time used by the CPU to run virtual CPU. Modify /proc/stat to display this new field. Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net> Acked-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: domain sysctl fixes: add terminator commentMilton Miller2007-10-151-0/+1
| | | | | | | | | | | | | | | | we had an incorrect-terminator bug in sd_alloc_ctl_domain_table() before, so add a comment that documents it. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: domain sysctl fixes: do not crash on allocation failureMilton Miller2007-10-151-2/+8
| | | | | | | | | | | | | | | | | | Now that we are calling this at runtime, a more relaxed error path is suggested. If an allocation fails, we just register the partial table, which will show empty directories. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: domain sysctl fixes: unregister the sysctl table before domainsMilton Miller2007-10-151-4/+30
| | | | | | | | | | | | | | | | | | Unregister and free the sysctl table before destroying domains, then rebuild and register after creating the new domains. This prevents the sysctl table from pointing to freed memory for root to write. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: domain sysctl fixes: use for_each_online_cpu()Milton Miller2007-10-151-1/+2
| | | | | | | | | | | | | | | | | | | | init_sched_domain_sysctl was walking cpus 0-n and referencing per_cpu variables. If the cpus_possible mask is not contigious this will result in a crash referencing unallocated data. If the online mask is not contigious then we would show offline cpus and miss online ones. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: domain sysctl fixes: use kcalloc()Milton Miller2007-10-151-3/+2
| | | | | | | | | | | | | | kcalloc checks for n * sizeof(element) overflows and it zeros. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * Make scheduler debug file operations constArjan van de Ven2007-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | In general, struct file_operations are const in the kernel, to not have false cacheline sharing and to catch bugs at compiletime with accidental writes to them. The new scheduler code introduces a new non-const one; fix this up. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: enable wake-idle on CONFIG_SCHED_MC=yIngo Molnar2007-10-151-3/+4
| | | | | | | | | | | | | | most multicore CPUs today have shared L2 caches, so tune things so that the spreading amongst cores is more aggressive. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: reintroduce topology.h tuningsIngo Molnar2007-10-151-7/+5
| | | | | | | | | | | | | | reintroduce the 2.6.22 topology.h tunings again - they result in slightly better balancing. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: allow the immediate migration of cache-cold tasksIngo Molnar2007-10-151-1/+7
| | | | | | | | | | | | allow the immediate migration of cache-cold tasks. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: debug, improve migration statisticsIngo Molnar2007-10-153-32/+149
| | | | | | | | | | | | | | add new migration statistics when SCHED_DEBUG and SCHEDSTATS is enabled. Available in /proc/<PID>/sched. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: debug: increase width of debug lineIngo Molnar2007-10-151-6/+7
| | | | | | | | | | | | increase width of debug line - in preparation of more debugging info. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: activate task_hot() only on fair-scheduled tasksPeter Zijlstra2007-10-151-3/+8
| | | | | | | | | | | | | | | | activate task_hot() only for fair-scheduled tasks (i.e. disable it for RT tasks). Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: reintroduce cache-hot affinityIngo Molnar2007-10-154-0/+38
| | | | | | | | | | | | | | | | reintroduce a simplified version of cache-hot/cold scheduling affinity. This improves performance with certain SMP workloads, such as sysbench. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: speed up context-switches a bitIngo Molnar2007-10-151-11/+0
| | | | | | | | | | | | | | | | | | speed up context-switches a bit by not clearing p->exec_start. (as a side-effect, this also makes p->exec_start a universal timestamp available to cache-hot estimations.) Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: do not wakeup-preempt with SCHED_BATCH tasksIngo Molnar2007-10-151-0/+6
| | | | | | | | | | | | | | do not wakeup-preempt with SCHED_BATCH tasks, their preemption is batched too, driven by the tick. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: generate uevents for user creation/destructionSrivatsa Vaddagiri2007-10-151-0/+4
| | | | | | | | | | | | | | | | | | Generate uevents when a user is being created/destroyed. These events can be used to configure cpu share of a new user. Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: do not normalize kernel threads via SysRq-NIngo Molnar2007-10-151-11/+7
| | | | | | | | | | | | | | | | | | | | do not normalize kernel threads via SysRq-N: the migration threads, softlockup threads, etc. might be essential for the system to function properly. So only zap user tasks. pointed out by Andi Kleen. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: remove stale comment from sched_group_set_shares()Andi Kleen2007-10-151-2/+0
| | | | | | | | | | | | | | | | | | remove stale comment from sched_group_set_shares(). Function never returns -EINVAL. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: clean up is_migration_thread()Ingo Molnar2007-10-151-6/+9
| | | | | | | | | | | | clean up is_migration_thread() and turn it into an inline function. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup: refactor normalize_rt_tasksAndi Kleen2007-10-151-20/+23
| | | | | | | | | | | | | | | | Replace a particularly ugly ifdef with an inline and a new macro. Also split up the function to be easier to read. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup: refactor common code of sleep_on / wait_for_completionAndi Kleen2007-10-151-139/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | Refactor common code of sleep_on / wait_for_completion These functions were largely cut'n'pasted. This moves the common code into single helpers instead. Advantage is about 1k less code on x86-64 and 91 lines of code removed. It adds one function call to the non timeout version of the functions; i don't expect this to be measurable. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup: remove unnecessary gotosAndi Kleen2007-10-151-165/+162
| | | | | | | | | | | | | | | | | | | | Replace loops implemented with gotos with real loops. Replace err = ...; goto x; x: return err; with return ...; No functional changes. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: update commentIngo Molnar2007-10-151-7/+5
| | | | | | | | | | | | update comment: clarify time-slices and remove obsolete tuning detail. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: prevent wakeup over-schedulingMike Galbraith2007-10-153-4/+15
| | | | | | | | | | | | | | | | | | | | | | Prevent wakeup over-scheduling. Once a task has been preempted by a task of the same or lower priority, it becomes ineligible for repeated preemption by same until it has been ticked, or slept. Instead, the task is marked for preemption at the next tick. Tasks of higher priority still preempt immediately. Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: disable forced preemption by defaultPeter Zijlstra2007-10-152-12/+16
| | | | | | | | | | | | | | | | Implement feature bit to disable forced preemption. This way it can be checked whether a workload is overscheduling or not. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: fix group scheduling for SCHED_BATCHDmitry Adamushko2007-10-151-3/+2
| | | | | | | | | | | | | | | | | | The following patch (sched: disable sleeper_fairness on SCHED_BATCH) seems to break GROUP_SCHED. Although, it may be 'oops'-less due to the possibility of 'p' being always a valid address. Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: some proc entries are missed in sched_domain sys_ctl debug codeZou Nan hai2007-10-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | cache_nice_tries and flags entry do not appear in proc fs sched_domain directory, because ctl_table entry is skipped. This patch fixes the issue. Signed-off-by: Zou Nan hai <nanhai.zou@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: fix rt ptracer monopolizing CPUGautham R Shenoy2007-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | yield() in wait_task_inactive(), can cause a high priority thread to be scheduled back in, and there by loop forever while it is waiting for some lower priority thread which is unfortunately still on the runqueue. Use schedule_timeout_uninterruptible(1) instead. Signed-off-by: Gautham R Shenoy <ego@in.ibm.com> Credit: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: group scheduling, sysfs tunablesDhaval Giani2007-10-156-79/+309
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tunables in sysfs to modify a user's cpu share. A directory is created in sysfs for each new user in the system. /sys/kernel/uids/<uid>/cpu_share Reading this file returns the cpu shares granted for the user. Writing into this file modifies the cpu share for the user. Only an administrator is allowed to modify a user's cpu share. Ex: # cd /sys/kernel/uids/ # cat 512/cpu_share 1024 # echo 2048 > 512/cpu_share # cat 512/cpu_share 2048 # Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: disable sleeper_fairness on SCHED_BATCHPeter Zijlstra2007-10-151-1/+3
| | | | | | | | | | | | | | | | disable sleeper fairness for batch tasks - they are about batch processing after all. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: another wakeup_granularity fixPeter Zijlstra2007-10-151-2/+5
| | | | | | | | | | | | | | unit mis-match: wakeup_gran was used against a vruntime Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: export cpu_clock()Paul E. McKenney2007-10-151-0/+1
| | | | | | | | | | | | | | | | export cpu_clock() - the preferred API instead of sched_clock(). Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: fix: move the CPU check into ->task_new_fair()Ingo Molnar2007-10-152-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | noticed by Peter Zijlstra: fix: move the CPU check into ->task_new_fair(), this way we can call place_entity() and get child ->vruntime right at initial wakeup time. (without this there can be large latencies) Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
| * sched: cleanup: function prototype cleanupsIngo Molnar2007-10-151-10/+5
| | | | | | | | | | | | | | | | | | noticed by Thomas Gleixner: cleanup: function prototype cleanups - move into single line wherever possible. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup: rename task_grp to task_groupIngo Molnar2007-10-154-28/+28
| | | | | | | | | | | | | | cleanup: rename task_grp to task_group. No need to save two characters and 'grp' is annoying to read. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup: rename SCHED_FEAT_USE_TREE_AVG to SCHED_FEAT_TREE_AVGIngo Molnar2007-10-152-3/+3
| | | | | | | | | | | | | | cleanup: rename SCHED_FEAT_USE_TREE_AVG to SCHED_FEAT_TREE_AVG, to make SCHED_FEAT_ names more consistent. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: kfree(NULL) is validIngo Molnar2007-10-151-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | kfree(NULL) is valid. pointed out by checkpatch.pl. the fix shrinks the code a bit: text data bss dec hex filename 40024 3842 100 43966 abbe sched.o.before 40002 3842 100 43944 aba8 sched.o.after Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: style cleanupIngo Molnar2007-10-151-1/+1
| | | | | | | | | | | | fix up __setup() style bug - noticed via checkpatch.pl. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: break out if printing a warning in sched_domain_debug()Ingo Molnar2007-10-151-0/+3
| | | | | | | | | | | | | | checkpatch.pl and Andy Whitcroft noticed the following bug: we did not break out after printing an error. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: run sched_domain_debug() if CONFIG_SCHED_DEBUG=yIngo Molnar2007-10-151-2/+1
| | | | | | | | | | | | | | run sched_domain_debug() if CONFIG_SCHED_DEBUG=y, instead of relying on the hand-crafted SCHED_DOMAIN_DEBUG switch. Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup, remove the TASK_NONINTERACTIVE flagMike Galbraith2007-10-152-4/+2
| | | | | | | | | | | | | | | | | | Here's another piece of low hanging obsolete fruit. Remove obsolete TASK_NONINTERACTIVE. Signed-off-by: Mike Galbraith <efault@gmx.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup, make dequeue_entity() and update_stats_wait_end() similarDmitry Adamushko2007-10-151-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | make dequeue_entity() / enqueue_entity() and update_stats_dequeue() / update_stats_enqueue() look similar, structure-wise. zero effect, functionality-wise: text data bss dec hex filename 34550 3026 100 37676 932c sched.o.before 34550 3026 100 37676 932c sched.o.after Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
| * sched: cleanup, remove calc_weighted()Dmitry Adamushko2007-10-151-11/+0
| | | | | | | | | | | | | | remove obsolete code -- calc_weighted() Signed-off-by: Dmitry Adamushko <dmitry.adamushko@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>