diff options
| author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 11:22:16 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 11:22:16 -0400 |
| commit | b5869ce7f68b233ceb81465a7644be0d9a5f3dbb (patch) | |
| tree | e3611e7f038a4a4fa813532ae57a9a626fa1434d | |
| parent | df3d80f5a5c74168be42788364d13cf6c83c7b9c (diff) | |
| parent | 9c63d9c021f375a2708ad79043d6f4dd1291a085 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched
* 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
...
| -rw-r--r-- | Documentation/sched-design-CFS.txt | 67 | ||||
| -rw-r--r-- | arch/i386/Kconfig | 11 | ||||
| -rw-r--r-- | drivers/kvm/kvm.h | 10 | ||||
| -rw-r--r-- | drivers/kvm/kvm_main.c | 2 | ||||
| -rw-r--r-- | fs/pipe.c | 9 | ||||
| -rw-r--r-- | fs/proc/array.c | 17 | ||||
| -rw-r--r-- | fs/proc/base.c | 2 | ||||
| -rw-r--r-- | fs/proc/proc_misc.c | 15 | ||||
| -rw-r--r-- | include/linux/kernel_stat.h | 1 | ||||
| -rw-r--r-- | include/linux/sched.h | 99 | ||||
| -rw-r--r-- | include/linux/topology.h | 5 | ||||
| -rw-r--r-- | init/Kconfig | 21 | ||||
| -rw-r--r-- | kernel/delayacct.c | 2 | ||||
| -rw-r--r-- | kernel/exit.c | 6 | ||||
| -rw-r--r-- | kernel/fork.c | 3 | ||||
| -rw-r--r-- | kernel/ksysfs.c | 8 | ||||
| -rw-r--r-- | kernel/sched.c | 1444 | ||||
| -rw-r--r-- | kernel/sched_debug.c | 282 | ||||
| -rw-r--r-- | kernel/sched_fair.c | 811 | ||||
| -rw-r--r-- | kernel/sched_idletask.c | 8 | ||||
| -rw-r--r-- | kernel/sched_rt.c | 19 | ||||
| -rw-r--r-- | kernel/sched_stats.h | 28 | ||||
| -rw-r--r-- | kernel/sysctl.c | 37 | ||||
| -rw-r--r-- | kernel/user.c | 249 | ||||
| -rw-r--r-- | net/unix/af_unix.c | 4 |
25 files changed, 1872 insertions, 1288 deletions
diff --git a/Documentation/sched-design-CFS.txt b/Documentation/sched-design-CFS.txt index 84901e7c0508..88bcb8767335 100644 --- a/Documentation/sched-design-CFS.txt +++ b/Documentation/sched-design-CFS.txt | |||
| @@ -117,3 +117,70 @@ Some implementation details: | |||
| 117 | iterators of the scheduling modules are used. The balancing code got | 117 | iterators of the scheduling modules are used. The balancing code got |
| 118 | quite a bit simpler as a result. | 118 | quite a bit simpler as a result. |
| 119 | 119 | ||
| 120 | |||
| 121 | Group scheduler extension to CFS | ||
| 122 | ================================ | ||
| 123 | |||
| 124 | Normally the scheduler operates on individual tasks and strives to provide | ||
| 125 | fair CPU time to each task. Sometimes, it may be desirable to group tasks | ||
| 126 | and provide fair CPU time to each such task group. For example, it may | ||
| 127 | be desirable to first provide fair CPU time to each user on the system | ||
| 128 | and then to each task belonging to a user. | ||
| 129 | |||
| 130 | CONFIG_FAIR_GROUP_SCHED strives to achieve exactly that. It lets | ||
| 131 | SCHED_NORMAL/BATCH tasks be be grouped and divides CPU time fairly among such | ||
| 132 | groups. At present, there are two (mutually exclusive) mechanisms to group | ||
| 133 | tasks for CPU bandwidth control purpose: | ||
| 134 | |||
| 135 | - Based on user id (CONFIG_FAIR_USER_SCHED) | ||
| 136 | In this option, tasks are grouped according to their user id. | ||
| 137 | - Based on "cgroup" pseudo filesystem (CONFIG_FAIR_CGROUP_SCHED) | ||
| 138 | This options lets the administrator create arbitrary groups | ||
| 139 | of tasks, using the "cgroup" pseudo filesystem. See | ||
| 140 | Documentation/cgroups.txt for more information about this | ||
| 141 | filesystem. | ||
| 142 | |||
| 143 | Only one of these options to group tasks can be chosen and not both. | ||
| 144 | |||
| 145 | Group scheduler tunables: | ||
| 146 | |||
| 147 | When CONFIG_FAIR_USER_SCHED is defined, a directory is created in sysfs for | ||
| 148 | each new user and a "cpu_share" file is added in that directory. | ||
| 149 | |||
| 150 | # cd /sys/kernel/uids | ||
| 151 | # cat 512/cpu_share # Display user 512's CPU share | ||
| 152 | 1024 | ||
| 153 | # echo 2048 > 512/cpu_share # Modify user 512's CPU share | ||
| 154 | # cat 512/cpu_share # Display user 512's CPU share | ||
| 155 | 2048 | ||
| 156 | # | ||
| 157 | |||
| 158 | CPU bandwidth between two users are divided in the ratio of their CPU shares. | ||
| 159 | For ex: if you would like user "root" to get twice the bandwidth of user | ||
| 160 | "guest", then set the cpu_share for both the users such that "root"'s | ||
| 161 | cpu_share is twice "guest"'s cpu_share | ||
| 162 | |||
| 163 | |||
| 164 | When CONFIG_FAIR_CGROUP_SCHED is defined, a "cpu.shares" file is created | ||
| 165 | for each group created using the pseudo filesystem. See example steps | ||
| 166 | below to create task groups and modify their CPU share using the "cgroups" | ||
| 167 | pseudo filesystem | ||
| 168 | |||
| 169 | # mkdir /dev/cpuctl | ||
| 170 | # mount -t cgroup -ocpu none /dev/cpuctl | ||
| 171 | # cd /dev/cpuctl | ||
| 172 | |||
| 173 | # mkdir multimedia # create "multimedia" group of tasks | ||
| 174 | # mkdir browser # create "browser" group of tasks | ||
| 175 | |||
| 176 | # #Configure the multimedia group to receive twice the CPU bandwidth | ||
| 177 | # #that of browser group | ||
| 178 | |||
| 179 | # echo 2048 > multimedia/cpu.shares | ||
| 180 | # echo 1024 > browser/cpu.shares | ||
| 181 | |||
| 182 | # firefox & # Launch firefox and move it to "browser" group | ||
| 183 | # echo <firefox_pid> > browser/tasks | ||
| 184 | |||
| 185 | # #Launch gmplayer (or your favourite movie player) | ||
| 186 | # echo <movie_player_pid> > multimedia/tasks | ||
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index f1486f8a3e6d..bf9aafad4978 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
| @@ -214,6 +214,17 @@ config X86_ES7000 | |||
| 214 | 214 | ||
| 215 | endchoice | 215 | endchoice |
| 216 | 216 | ||
| 217 | config SCHED_NO_NO_OMIT_FRAME_POINTER | ||
| 218 | bool "Single-depth WCHAN output" | ||
| 219 | default y | ||
| 220 | help | ||
| 221 | Calculate simpler /proc/<PID>/wchan values. If this option | ||
| 222 | is disabled then wchan values will recurse back to the | ||
| 223 | caller function. This provides more accurate wchan values, | ||
| 224 | at the expense of slightly more scheduling overhead. | ||
| 225 | |||
| 226 | If in doubt, say "Y". | ||
| 227 | |||
| 217 | config PARAVIRT | 228 | config PARAVIRT |
| 218 | bool "Paravirtualization support (EXPERIMENTAL)" | 229 | bool "Paravirtualization support (EXPERIMENTAL)" |
| 219 | depends on EXPERIMENTAL | 230 | depends on EXPERIMENTAL |
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h index ad0813843adc..3b0bc4bda5f2 100644 --- a/drivers/kvm/kvm.h +++ b/drivers/kvm/kvm.h | |||
| @@ -624,6 +624,16 @@ void kvm_mmu_unload(struct kvm_vcpu *vcpu); | |||
| 624 | 624 | ||
| 625 | int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run); | 625 | int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run); |
| 626 | 626 | ||
| 627 | static inline void kvm_guest_enter(void) | ||
| 628 | { | ||
| 629 | current->flags |= PF_VCPU; | ||
| 630 | } | ||
| 631 | |||
| 632 | static inline void kvm_guest_exit(void) | ||
| 633 | { | ||
| 634 | current->flags &= ~PF_VCPU; | ||
| 635 | } | ||
| 636 | |||
| 627 | static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, | 637 | static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, |
| 628 | u32 error_code) | 638 | u32 error_code) |
| 629 | { | 639 | { |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 353e58527d15..af2d288c881d 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
| @@ -2046,6 +2046,7 @@ again: | |||
| 2046 | kvm_x86_ops->inject_pending_vectors(vcpu, kvm_run); | 2046 | kvm_x86_ops->inject_pending_vectors(vcpu, kvm_run); |
| 2047 | 2047 | ||
| 2048 | vcpu->guest_mode = 1; | 2048 | vcpu->guest_mode = 1; |
| 2049 | kvm_guest_enter(); | ||
| 2049 | 2050 | ||
| 2050 | if (vcpu->requests) | 2051 | if (vcpu->requests) |
| 2051 | if (test_and_clear_bit(KVM_TLB_FLUSH, &vcpu->requests)) | 2052 | if (test_and_clear_bit(KVM_TLB_FLUSH, &vcpu->requests)) |
| @@ -2053,6 +2054,7 @@ again: | |||
| 2053 | 2054 | ||
| 2054 | kvm_x86_ops->run(vcpu, kvm_run); | 2055 | kvm_x86_ops->run(vcpu, kvm_run); |
| 2055 | 2056 | ||
| 2057 | kvm_guest_exit(); | ||
| 2056 | vcpu->guest_mode = 0; | 2058 | vcpu->guest_mode = 0; |
| 2057 | local_irq_enable(); | 2059 | local_irq_enable(); |
| 2058 | 2060 | ||
| @@ -45,8 +45,7 @@ void pipe_wait(struct pipe_inode_info *pipe) | |||
| 45 | * Pipes are system-local resources, so sleeping on them | 45 | * Pipes are system-local resources, so sleeping on them |
| 46 | * is considered a noninteractive wait: | 46 | * is considered a noninteractive wait: |
| 47 | */ | 47 | */ |
| 48 | prepare_to_wait(&pipe->wait, &wait, | 48 | prepare_to_wait(&pipe->wait, &wait, TASK_INTERRUPTIBLE); |
| 49 | TASK_INTERRUPTIBLE | TASK_NONINTERACTIVE); | ||
| 50 | if (pipe->inode) | 49 | if (pipe->inode) |
| 51 | mutex_unlock(&pipe->inode->i_mutex); | 50 | mutex_unlock(&pipe->inode->i_mutex); |
| 52 | schedule(); | 51 | schedule(); |
